1
0
mirror of https://github.com/golang/go synced 2024-09-25 01:30:13 -06:00

net: fix windows build

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7429049
This commit is contained in:
Mikio Hara 2013-03-03 19:10:59 +09:00
parent ed01f4be59
commit b767556dd7
2 changed files with 13 additions and 13 deletions

View 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 {

View 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)