summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/httpimg/httpimg_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/contrib/httpimg/httpimg_test.go b/contrib/httpimg/httpimg_test.go
index 3cd4218..8639bda 100644
--- a/contrib/httpimg/httpimg_test.go
+++ b/contrib/httpimg/httpimg_test.go
@@ -4,6 +4,7 @@ import (
"fmt"
"github.com/jung-kurt/gofpdf"
"github.com/jung-kurt/gofpdf/contrib/httpimg"
+ "os"
"path/filepath"
)
@@ -12,6 +13,20 @@ const (
cnExampleDir = cnGofpdfDir + "/pdf"
)
+func init() {
+ cleanup()
+}
+
+func cleanup() {
+ filepath.Walk(cnExampleDir,
+ func(path string, info os.FileInfo, err error) (reterr error) {
+ if path[len(path)-4:] == ".pdf" {
+ os.Remove(path)
+ }
+ return
+ })
+}
+
func exampleFilename(baseStr string) string {
return filepath.Join(cnExampleDir, baseStr+".pdf")
}