OSDN Git Service

net/http: delete temporary files.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Dec 2011 18:45:08 +0000 (18:45 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Dec 2011 18:45:08 +0000 (18:45 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182256 138bc75d-0d04-0410-961f-82ee72b054a4

libgo/go/net/http/filetransport_test.go

index 265a3b9..039926b 100644 (file)
@@ -7,6 +7,7 @@ package http_test
 import (
        "io/ioutil"
        "net/http"
 import (
        "io/ioutil"
        "net/http"
+       "os"
        "path/filepath"
        "testing"
 )
        "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)
        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)))
 
        tr := &http.Transport{}
        tr.RegisterProtocol("file", http.NewFileTransport(http.Dir(dname)))