Commit fe4bf59f by Ian Lance Taylor

net/http: delete temporary files.

From-SVN: r182256
parent 0b272848
...@@ -7,6 +7,7 @@ package http_test ...@@ -7,6 +7,7 @@ package http_test
import ( import (
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"os"
"path/filepath" "path/filepath"
"testing" "testing"
) )
...@@ -28,6 +29,8 @@ func TestFileTransport(t *testing.T) { ...@@ -28,6 +29,8 @@ func TestFileTransport(t *testing.T) {
fname := filepath.Join(dname, "foo.txt") fname := filepath.Join(dname, "foo.txt")
err = ioutil.WriteFile(fname, []byte("Bar"), 0644) err = ioutil.WriteFile(fname, []byte("Bar"), 0644)
check("WriteFile", err) check("WriteFile", err)
defer os.Remove(dname)
defer os.Remove(fname)
tr := &http.Transport{} tr := &http.Transport{}
tr.RegisterProtocol("file", http.NewFileTransport(http.Dir(dname))) tr.RegisterProtocol("file", http.NewFileTransport(http.Dir(dname)))
......
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