]> Cypherpunks repositories - gostls13.git/commitdiff
net: fix windows build
authorMikio Hara <mikioh.mikioh@gmail.com>
Sun, 3 Mar 2013 10:10:59 +0000 (19:10 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Sun, 3 Mar 2013 10:10:59 +0000 (19:10 +0900)
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7429049

src/pkg/net/protoconn_test.go
src/pkg/net/unix_test.go

index 74ae320fe3bdbb368da75f6ca8b32fcf6c2946e6..de0c2c00a65f51327de6126407b86d6120458af1 100644 (file)
@@ -8,12 +8,25 @@
 package net
 
 import (
+       "io/ioutil"
        "os"
        "runtime"
        "testing"
        "time"
 )
 
+// testUnixAddr uses ioutil.TempFile to get a name that is unique.
+func testUnixAddr() string {
+       f, err := ioutil.TempFile("", "nettest")
+       if err != nil {
+               panic(err)
+       }
+       addr := f.Name()
+       f.Close()
+       os.Remove(addr)
+       return addr
+}
+
 var condFatalf = func() func(*testing.T, string, ...interface{}) {
        // A few APIs are not implemented yet on both Plan 9 and Windows.
        switch runtime.GOOS {
index dda717ea9388fbfd744858020e4bbab74db57dbd..2eaabe86e45eb7dfe4701fa586852d666661bce2 100644 (file)
@@ -8,7 +8,6 @@ package net
 
 import (
        "bytes"
-       "io/ioutil"
        "os"
        "reflect"
        "runtime"
@@ -17,18 +16,6 @@ import (
        "time"
 )
 
-// testUnixAddr uses ioutil.TempFile to get a name that is unique.
-func testUnixAddr() string {
-       f, err := ioutil.TempFile("", "nettest")
-       if err != nil {
-               panic(err)
-       }
-       addr := f.Name()
-       f.Close()
-       os.Remove(addr)
-       return addr
-}
-
 func TestReadUnixgramWithUnnamedSocket(t *testing.T) {
        addr := testUnixAddr()
        la, err := ResolveUnixAddr("unixgram", addr)