Commit e5a7ab85 authored by Mikio Hara's avatar Mikio Hara

net: fix nits found by go tool vet

R=golang-dev, dave, adg
CC=golang-dev
https://golang.org/cl/27430043
parent a4b66b77
...@@ -231,12 +231,12 @@ func TestErrorNil(t *testing.T) { ...@@ -231,12 +231,12 @@ func TestErrorNil(t *testing.T) {
// Make Listen fail by relistening on the same address. // Make Listen fail by relistening on the same address.
l, err := Listen("tcp", "127.0.0.1:0") l, err := Listen("tcp", "127.0.0.1:0")
if err != nil { if err != nil {
t.Fatal("Listen 127.0.0.1:0: %v", err) t.Fatalf("Listen 127.0.0.1:0: %v", err)
} }
defer l.Close() defer l.Close()
l1, err := Listen("tcp", l.Addr().String()) l1, err := Listen("tcp", l.Addr().String())
if err == nil { if err == nil {
t.Fatal("second Listen %v: %v", l.Addr(), err) t.Fatalf("second Listen %v: %v", l.Addr(), err)
} }
if l1 != nil { if l1 != nil {
t.Fatalf("Listen returned non-nil interface %T(%v) with err != nil", l1, l1) t.Fatalf("Listen returned non-nil interface %T(%v) with err != nil", l1, l1)
...@@ -245,12 +245,12 @@ func TestErrorNil(t *testing.T) { ...@@ -245,12 +245,12 @@ func TestErrorNil(t *testing.T) {
// Make ListenPacket fail by relistening on the same address. // Make ListenPacket fail by relistening on the same address.
lp, err := ListenPacket("udp", "127.0.0.1:0") lp, err := ListenPacket("udp", "127.0.0.1:0")
if err != nil { if err != nil {
t.Fatal("Listen 127.0.0.1:0: %v", err) t.Fatalf("Listen 127.0.0.1:0: %v", err)
} }
defer lp.Close() defer lp.Close()
lp1, err := ListenPacket("udp", lp.LocalAddr().String()) lp1, err := ListenPacket("udp", lp.LocalAddr().String())
if err == nil { if err == nil {
t.Fatal("second Listen %v: %v", lp.LocalAddr(), err) t.Fatalf("second Listen %v: %v", lp.LocalAddr(), err)
} }
if lp1 != nil { if lp1 != nil {
t.Fatalf("ListenPacket returned non-nil interface %T(%v) with err != nil", lp1, lp1) t.Fatalf("ListenPacket returned non-nil interface %T(%v) with err != nil", lp1, lp1)
......
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