cleanup dataXXX in /tmp

parent 03f5866e
...@@ -22,6 +22,7 @@ import ( ...@@ -22,6 +22,7 @@ import (
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"net/url" "net/url"
"os"
"path/filepath" "path/filepath"
"strings" "strings"
"testing" "testing"
...@@ -225,6 +226,7 @@ func TestFileServing(t *testing.T) { ...@@ -225,6 +226,7 @@ func TestFileServing(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("error creating tmp dir: %v", err) t.Fatalf("error creating tmp dir: %v", err)
} }
defer os.RemoveAll(dir)
if err := ioutil.WriteFile(filepath.Join(dir, fname), []byte(data), 0755); err != nil { if err := ioutil.WriteFile(filepath.Join(dir, fname), []byte(data), 0755); err != nil {
t.Fatalf("error writing tmp file: %v", err) t.Fatalf("error writing tmp file: %v", err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment