diff options
Diffstat (limited to 'fpdf_test.go')
-rw-r--r-- | fpdf_test.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fpdf_test.go b/fpdf_test.go index 966767f..e45f966 100644 --- a/fpdf_test.go +++ b/fpdf_test.go @@ -40,9 +40,14 @@ func init() { func cleanup() { filepath.Walk(example.PdfDir(), func(path string, info os.FileInfo, err error) (reterr error) { - if len(path) > 3 { - if path[len(path)-4:] == ".pdf" { - os.Remove(path) + if info.Mode().IsRegular() { + dir, _ := filepath.Split(path) + if "reference" != filepath.Base(dir) { + if len(path) > 3 { + if path[len(path)-4:] == ".pdf" { + os.Remove(path) + } + } } } return |