1
0
mirror of https://github.com/golang/go synced 2024-11-18 11:24:41 -07:00

net: align temporary file, directory names in tests

Also adds missing temporary file deletion.

Change-Id: Ia644b0898022e05d2f5232af38f51d55e40c6fb5
Reviewed-on: https://go-review.googlesource.com/9772
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Mikio Hara 2015-05-06 10:41:01 +09:00
parent aebd123e8c
commit 76d67eaccc
3 changed files with 4 additions and 3 deletions

View File

@ -101,7 +101,7 @@ type resolvConfTest struct {
} }
func newResolvConfTest(t *testing.T) *resolvConfTest { func newResolvConfTest(t *testing.T) *resolvConfTest {
dir, err := ioutil.TempDir("", "resolvConfTest") dir, err := ioutil.TempDir("", "go-resolvconftest")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }

View File

@ -524,10 +524,11 @@ func TestFileError(t *testing.T) {
t.Skip("not supported on %s", runtime.GOOS) t.Skip("not supported on %s", runtime.GOOS)
} }
f, err := ioutil.TempFile("", "nettest") f, err := ioutil.TempFile("", "go-nettest")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
defer os.Remove(f.Name())
defer f.Close() defer f.Close()
c, err := FileConn(f) c, err := FileConn(f)

View File

@ -18,7 +18,7 @@ import (
// It also uses /tmp directory in case it is prohibited to create UNIX // It also uses /tmp directory in case it is prohibited to create UNIX
// sockets in TMPDIR. // sockets in TMPDIR.
func testUnixAddr() string { func testUnixAddr() string {
f, err := ioutil.TempFile("", "nettest") f, err := ioutil.TempFile("", "go-nettest")
if err != nil { if err != nil {
panic(err) panic(err)
} }