Commit b767556d authored by Mikio Hara's avatar Mikio Hara

net: fix windows build

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7429049
parent ed01f4be
......@@ -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 {
......
......@@ -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)
......
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