summaryrefslogtreecommitdiff
path: root/libgo/go/net/file_test.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-02-11 14:53:56 -0800
committerIan Lance Taylor <iant@golang.org>2022-02-11 15:01:19 -0800
commit8dc2499aa62f768c6395c9754b8cabc1ce25c494 (patch)
tree43d7fd2bbfd7ad8c9625a718a5e8718889351994 /libgo/go/net/file_test.go
parent9a56779dbc4e2d9c15be8d31e36f2f59be7331a8 (diff)
downloadgcc-8dc2499aa62f768c6395c9754b8cabc1ce25c494.tar.gz
libgo: update to Go1.18beta2
gotools/ * Makefile.am (go_cmd_cgo_files): Add ast_go118.go (check-go-tool): Copy golang.org/x/tools directories. * Makefile.in: Regenerate. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/384695
Diffstat (limited to 'libgo/go/net/file_test.go')
-rw-r--r--libgo/go/net/file_test.go36
1 files changed, 13 insertions, 23 deletions
diff --git a/libgo/go/net/file_test.go b/libgo/go/net/file_test.go
index a70ef1b312f..ea2a218dfbc 100644
--- a/libgo/go/net/file_test.go
+++ b/libgo/go/net/file_test.go
@@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build !js
-// +build !js
package net
@@ -45,10 +44,7 @@ func TestFileConn(t *testing.T) {
var network, address string
switch tt.network {
case "udp":
- c, err := newLocalPacketListener(tt.network)
- if err != nil {
- t.Fatal(err)
- }
+ c := newLocalPacketListener(t, tt.network)
defer c.Close()
network = c.LocalAddr().Network()
address = c.LocalAddr().String()
@@ -62,10 +58,7 @@ func TestFileConn(t *testing.T) {
var b [1]byte
c.Read(b[:])
}
- ls, err := newLocalServer(tt.network)
- if err != nil {
- t.Fatal(err)
- }
+ ls := newLocalServer(t, tt.network)
defer ls.teardown()
if err := ls.buildup(handler); err != nil {
t.Fatal(err)
@@ -149,17 +142,17 @@ func TestFileListener(t *testing.T) {
continue
}
- ln1, err := newLocalListener(tt.network)
- if err != nil {
- t.Fatal(err)
- }
+ ln1 := newLocalListener(t, tt.network)
switch tt.network {
case "unix", "unixpacket":
defer os.Remove(ln1.Addr().String())
}
addr := ln1.Addr()
- var f *os.File
+ var (
+ f *os.File
+ err error
+ )
switch ln1 := ln1.(type) {
case *TCPListener:
f, err = ln1.File()
@@ -241,17 +234,17 @@ func TestFilePacketConn(t *testing.T) {
continue
}
- c1, err := newLocalPacketListener(tt.network)
- if err != nil {
- t.Fatal(err)
- }
+ c1 := newLocalPacketListener(t, tt.network)
switch tt.network {
case "unixgram":
defer os.Remove(c1.LocalAddr().String())
}
addr := c1.LocalAddr()
- var f *os.File
+ var (
+ f *os.File
+ err error
+ )
switch c1 := c1.(type) {
case *UDPConn:
f, err = c1.File()
@@ -315,10 +308,7 @@ func TestFileCloseRace(t *testing.T) {
c.Read(b[:])
}
- ls, err := newLocalServer("tcp")
- if err != nil {
- t.Fatal(err)
- }
+ ls := newLocalServer(t, "tcp")
defer ls.teardown()
if err := ls.buildup(handler); err != nil {
t.Fatal(err)