mirror of
https://github.com/golang/go.git
synced 2025-05-29 19:35:42 +00:00
net: fix vet warnings
Updates #11041 Change-Id: I12c20beab75d7981efe470eb418e4b58dc8eb066 Reviewed-on: https://go-review.googlesource.com/20002 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
0d1a98e210
commit
1c94e7276e
@ -28,7 +28,7 @@ func TestStructPackUnpack(t *testing.T) {
|
|||||||
t.Fatal("unpacking failed")
|
t.Fatal("unpacking failed")
|
||||||
}
|
}
|
||||||
if n != len(buf) {
|
if n != len(buf) {
|
||||||
t.Error("unpacked different amount than packed: got n = %d, want = %d", n, len(buf))
|
t.Errorf("unpacked different amount than packed: got n = %d, want = %d", n, len(buf))
|
||||||
}
|
}
|
||||||
if !reflect.DeepEqual(got, want) {
|
if !reflect.DeepEqual(got, want) {
|
||||||
t.Errorf("got = %+v, want = %+v", got, want)
|
t.Errorf("got = %+v, want = %+v", got, want)
|
||||||
@ -69,7 +69,7 @@ func TestDomainNamePackUnpack(t *testing.T) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if n != len(buf) {
|
if n != len(buf) {
|
||||||
t.Error(
|
t.Errorf(
|
||||||
"unpacked different amount than packed for %s: got n = %d, want = %d",
|
"unpacked different amount than packed for %s: got n = %d, want = %d",
|
||||||
test.in,
|
test.in,
|
||||||
n,
|
n,
|
||||||
|
@ -95,6 +95,6 @@ func TestServerCloseClientConnections(t *testing.T) {
|
|||||||
res, err := http.Get(s.URL)
|
res, err := http.Get(s.URL)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
res.Body.Close()
|
res.Body.Close()
|
||||||
t.Fatal("Unexpected response: %#v", res)
|
t.Fatalf("Unexpected response: %#v", res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -561,24 +561,24 @@ func TestInterfaceHardwareAddrWithGetmac(t *testing.T) {
|
|||||||
if bytes.Contains(line, []byte("Connection Name:")) {
|
if bytes.Contains(line, []byte("Connection Name:")) {
|
||||||
f := bytes.Split(line, []byte{':'})
|
f := bytes.Split(line, []byte{':'})
|
||||||
if len(f) != 2 {
|
if len(f) != 2 {
|
||||||
t.Fatal("unexpected \"Connection Name\" line: %q", line)
|
t.Fatalf("unexpected \"Connection Name\" line: %q", line)
|
||||||
}
|
}
|
||||||
name = string(bytes.TrimSpace(f[1]))
|
name = string(bytes.TrimSpace(f[1]))
|
||||||
if name == "" {
|
if name == "" {
|
||||||
t.Fatal("empty name on \"Connection Name\" line: %q", line)
|
t.Fatalf("empty name on \"Connection Name\" line: %q", line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if bytes.Contains(line, []byte("Physical Address:")) {
|
if bytes.Contains(line, []byte("Physical Address:")) {
|
||||||
if name == "" {
|
if name == "" {
|
||||||
t.Fatal("no matching name found: %q", string(out))
|
t.Fatalf("no matching name found: %q", string(out))
|
||||||
}
|
}
|
||||||
f := bytes.Split(line, []byte{':'})
|
f := bytes.Split(line, []byte{':'})
|
||||||
if len(f) != 2 {
|
if len(f) != 2 {
|
||||||
t.Fatal("unexpected \"Physical Address\" line: %q", line)
|
t.Fatalf("unexpected \"Physical Address\" line: %q", line)
|
||||||
}
|
}
|
||||||
addr := string(bytes.ToLower(bytes.TrimSpace(f[1])))
|
addr := string(bytes.ToLower(bytes.TrimSpace(f[1])))
|
||||||
if addr == "" {
|
if addr == "" {
|
||||||
t.Fatal("empty address on \"Physical Address\" line: %q", line)
|
t.Fatalf("empty address on \"Physical Address\" line: %q", line)
|
||||||
}
|
}
|
||||||
if addr == "disabled" || addr == "n/a" {
|
if addr == "disabled" || addr == "n/a" {
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user