]> Cypherpunks repositories - gostls13.git/commitdiff
all: minor vet fixes
authorJosh Bleecher Snyder <josharian@gmail.com>
Sun, 23 Oct 2016 21:10:11 +0000 (14:10 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 24 Oct 2016 17:27:37 +0000 (17:27 +0000)
Change-Id: I22f0f3e792052762499f632571155768b4052bc9
Reviewed-on: https://go-review.googlesource.com/31759
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/compress/gzip/example_test.go
src/crypto/tls/handshake_server_test.go
src/database/sql/example_test.go
src/math/modf_arm64.s
src/os/os_windows_test.go
src/reflect/all_test.go
src/text/template/exec_test.go

index e32346bb950d90736086563821b7e36ce2287274..ce29e9ba3656ed1e0b9eeaa3e6ddbd2373735672 100644 (file)
@@ -98,7 +98,7 @@ func ExampleReader_Multistream() {
                        log.Fatal(err)
                }
 
-               fmt.Println("\n")
+               fmt.Print("\n\n")
 
                err = zr.Reset(&buf)
                if err == io.EOF {
index 8d760ca10a9860d5fc201406973ecdcd0c1d6521..765a9745fcfe1850a8490a749cd9f35f89efef52 100644 (file)
@@ -1253,18 +1253,18 @@ func TestGetConfigForClient(t *testing.T) {
 
                if len(test.errorSubstring) == 0 {
                        if serverErr != nil || clientErr != nil {
-                               t.Errorf("%#d: expected no error but got serverErr: %q, clientErr: %q", i, serverErr, clientErr)
+                               t.Errorf("test[%d]: expected no error but got serverErr: %q, clientErr: %q", i, serverErr, clientErr)
                        }
                        if test.verify != nil {
                                if err := test.verify(configReturned); err != nil {
-                                       t.Errorf("#%d: verify returned error: %v", i, err)
+                                       t.Errorf("test[%d]: verify returned error: %v", i, err)
                                }
                        }
                } else {
                        if serverErr == nil {
-                               t.Errorf("%#d: expected error containing %q but got no error", i, test.errorSubstring)
+                               t.Errorf("test[%d]: expected error containing %q but got no error", i, test.errorSubstring)
                        } else if !strings.Contains(serverErr.Error(), test.errorSubstring) {
-                               t.Errorf("%#d: expected error to contain %q but it was %q", i, test.errorSubstring, serverErr)
+                               t.Errorf("test[%d]: expected error to contain %q but it was %q", i, test.errorSubstring, serverErr)
                        }
                }
        }
index 9032eac2d28573f6eae698370308bdd36d15fdfa..ce56ca4cb038718aeb0b2533860ff3dac5b77db8 100644 (file)
@@ -45,7 +45,7 @@ func ExampleDB_QueryRow() {
        }
 }
 
-func ExampleDB_QueryMultipleResultSets() {
+func ExampleDB_Query_multipleResultSets() {
        age := 27
        q := `
 create temp table uid (id bigint); -- Create temp table for queries.
index 0bdec4ebbe7243c25bf0e3eff47fd30aa6a74391..7c70ef33ac2398d43d375091d6a80fea75e2382f 100644 (file)
@@ -6,7 +6,7 @@
 
 // func Modf(f float64) (int float64, frac float64)
 TEXT ·Modf(SB),NOSPLIT,$0
-       MOVD    x+0(FP), R0
+       MOVD    f+0(FP), R0
        FMOVD   R0, F0
        FRINTZD F0, F1
        FMOVD   F1, int+8(FP)
index 72af075e5ba76a4a096f4e0c935ef4a0a7ab1183..f03d91517dc6adafb585642232d67c07e551d21d 100644 (file)
@@ -7,7 +7,6 @@ package os_test
 import (
        "bytes"
        "encoding/hex"
-       "fmt"
        "internal/syscall/windows"
        "internal/testenv"
        "io/ioutil"
@@ -274,7 +273,7 @@ func TestDirectoryJunction(t *testing.T) {
                                mklink: func(link, target string) error {
                                        output, err := osexec.Command("cmd", "/c", "mklink", "/J", link, target).CombinedOutput()
                                        if err != nil {
-                                               fmt.Errorf("failed to run mklink %v %v: %v %q", link, target, err, output)
+                                               t.Errorf("failed to run mklink %v %v: %v %q", link, target, err, output)
                                        }
                                        return nil
                                },
@@ -346,7 +345,7 @@ func TestDirectorySymbolicLink(t *testing.T) {
                                mklink: func(link, target string) error {
                                        output, err := osexec.Command("cmd", "/c", "mklink", "/D", link, target).CombinedOutput()
                                        if err != nil {
-                                               fmt.Errorf("failed to run mklink %v %v: %v %q", link, target, err, output)
+                                               t.Errorf("failed to run mklink %v %v: %v %q", link, target, err, output)
                                        }
                                        return nil
                                },
index 1d423f438615d3783a2f5cfb3f1f71e1df5162fc..c99ad79b64da6423a0fcb994ee84a1b0eaba5d99 100644 (file)
@@ -3119,7 +3119,7 @@ func ReadWriterV(x io.ReadWriter) Value {
 
 type Empty struct{}
 type MyStruct struct {
-       x int "tag"
+       x int `some:"tag"`
 }
 type MyString string
 type MyBytes []byte
@@ -3434,31 +3434,31 @@ var convertTests = []struct {
 
        // structs with different tags
        {V(struct {
-               x int "foo"
+               x int `some:"foo"`
        }{}), V(struct {
-               x int "bar"
+               x int `some:"bar"`
        }{})},
 
        {V(struct {
-               x int "bar"
+               x int `some:"bar"`
        }{}), V(struct {
-               x int "foo"
+               x int `some:"foo"`
        }{})},
 
        {V(MyStruct{}), V(struct {
-               x int "foo"
+               x int `some:"foo"`
        }{})},
 
        {V(struct {
-               x int "foo"
+               x int `some:"foo"`
        }{}), V(MyStruct{})},
 
        {V(MyStruct{}), V(struct {
-               x int "bar"
+               x int `some:"bar"`
        }{})},
 
        {V(struct {
-               x int "bar"
+               x int `some:"bar"`
        }{}), V(MyStruct{})},
 
        // can convert *byte and *MyByte
index 709296185030d47d64fb06c51ef2fd1941752054..1c7e115554570a8e211a91b5629bb0282768182e 100644 (file)
@@ -1326,7 +1326,7 @@ func TestAddrOfIndex(t *testing.T) {
                var buf bytes.Buffer
                err := tmpl.Execute(&buf, reflect.ValueOf([]V{{1}}))
                if err != nil {
-                       t.Fatal("%s: Execute: %v", text, err)
+                       t.Fatalf("%s: Execute: %v", text, err)
                }
                if buf.String() != "<1>" {
                        t.Fatalf("%s: template output = %q, want %q", text, buf, "<1>")