]> Cypherpunks repositories - gostls13.git/commitdiff
net: fix vet warnings
authorMohit Agarwal <mohit@sdf.org>
Tue, 1 Mar 2016 07:11:52 +0000 (12:41 +0530)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 2 Mar 2016 16:26:36 +0000 (16:26 +0000)
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>

src/net/dnsmsg_test.go
src/net/http/httptest/server_test.go
src/net/net_windows_test.go

index 339fb83c6299160420c00ed226683402f6a6f896..841c32fa84baddb202797c106673e496bfb20cc0 100644 (file)
@@ -28,7 +28,7 @@ func TestStructPackUnpack(t *testing.T) {
                t.Fatal("unpacking failed")
        }
        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) {
                t.Errorf("got = %+v, want = %+v", got, want)
@@ -69,7 +69,7 @@ func TestDomainNamePackUnpack(t *testing.T) {
                        continue
                }
                if n != len(buf) {
-                       t.Error(
+                       t.Errorf(
                                "unpacked different amount than packed for %s: got n = %d, want = %d",
                                test.in,
                                n,
index 61470c382283d0da966a129b3a30d7fb26398201..d032c5983b710351a40cf522bd7a9e0e00be93d2 100644 (file)
@@ -95,6 +95,6 @@ func TestServerCloseClientConnections(t *testing.T) {
        res, err := http.Get(s.URL)
        if err == nil {
                res.Body.Close()
-               t.Fatal("Unexpected response: %#v", res)
+               t.Fatalf("Unexpected response: %#v", res)
        }
 }
index ab217989690da13f91929e928370335f29cae51e..12846426635ac78f00a615c2b0d7837639e1e84c 100644 (file)
@@ -561,24 +561,24 @@ func TestInterfaceHardwareAddrWithGetmac(t *testing.T) {
                if bytes.Contains(line, []byte("Connection Name:")) {
                        f := bytes.Split(line, []byte{':'})
                        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]))
                        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 name == "" {
-                               t.Fatal("no matching name found: %q", string(out))
+                               t.Fatalf("no matching name found: %q", string(out))
                        }
                        f := bytes.Split(line, []byte{':'})
                        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])))
                        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" {
                                continue