From: Ian Lance Taylor Date: Mon, 12 Dec 2011 18:40:15 +0000 (-0800) Subject: net/http: make test remove temporary file and directory X-Git-Tag: weekly.2011-12-14~96 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=68ec347c16a7dd0b05bcc60ba683c219c60a47a6;p=gostls13.git net/http: make test remove temporary file and directory R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5486044 --- diff --git a/src/pkg/net/http/filetransport_test.go b/src/pkg/net/http/filetransport_test.go index 265a3b903e..039926b538 100644 --- a/src/pkg/net/http/filetransport_test.go +++ b/src/pkg/net/http/filetransport_test.go @@ -7,6 +7,7 @@ package http_test import ( "io/ioutil" "net/http" + "os" "path/filepath" "testing" ) @@ -28,6 +29,8 @@ func TestFileTransport(t *testing.T) { fname := filepath.Join(dname, "foo.txt") err = ioutil.WriteFile(fname, []byte("Bar"), 0644) check("WriteFile", err) + defer os.Remove(dname) + defer os.Remove(fname) tr := &http.Transport{} tr.RegisterProtocol("file", http.NewFileTransport(http.Dir(dname)))