Patchwork libgo patch committed: Remove temporary files

login
register
mail settings
Submitter Ian Taylor
Date Dec. 12, 2011, 6:45 p.m.
Message ID <mcrvcpl39zd.fsf@dhcp-172-18-216-180.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/130806/
State New
Headers show

Comments

Ian Taylor - Dec. 12, 2011, 6:45 p.m.
This patch to libgo brings over a patch I just committed to the master
library.  It deletes a temporary directory and file created during a
test.  Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian

Patch

diff -r 864416b061a9 libgo/go/net/http/filetransport_test.go
--- a/libgo/go/net/http/filetransport_test.go	Fri Dec 09 08:46:12 2011 -0800
+++ b/libgo/go/net/http/filetransport_test.go	Mon Dec 12 10:42:24 2011 -0800
@@ -7,6 +7,7 @@ 
 import (
 	"io/ioutil"
 	"net/http"
+	"os"
 	"path/filepath"
 	"testing"
 )
@@ -28,6 +29,8 @@ 
 	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)))