1
0
mirror of https://github.com/golang/go synced 2024-11-18 07:14:44 -07:00

all: minor vet fixes

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>
This commit is contained in:
Josh Bleecher Snyder 2016-10-23 14:10:11 -07:00
parent 212d2f82e0
commit accf5cc386
7 changed files with 19 additions and 20 deletions

View File

@ -98,7 +98,7 @@ func ExampleReader_Multistream() {
log.Fatal(err) log.Fatal(err)
} }
fmt.Println("\n") fmt.Print("\n\n")
err = zr.Reset(&buf) err = zr.Reset(&buf)
if err == io.EOF { if err == io.EOF {

View File

@ -1253,18 +1253,18 @@ func TestGetConfigForClient(t *testing.T) {
if len(test.errorSubstring) == 0 { if len(test.errorSubstring) == 0 {
if serverErr != nil || clientErr != nil { 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 test.verify != nil {
if err := test.verify(configReturned); err != 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 { } else {
if serverErr == nil { 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) { } 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)
} }
} }
} }

View File

@ -45,7 +45,7 @@ func ExampleDB_QueryRow() {
} }
} }
func ExampleDB_QueryMultipleResultSets() { func ExampleDB_Query_multipleResultSets() {
age := 27 age := 27
q := ` q := `
create temp table uid (id bigint); -- Create temp table for queries. create temp table uid (id bigint); -- Create temp table for queries.

View File

@ -6,7 +6,7 @@
// func Modf(f float64) (int float64, frac float64) // func Modf(f float64) (int float64, frac float64)
TEXT ·Modf(SB),NOSPLIT,$0 TEXT ·Modf(SB),NOSPLIT,$0
MOVD x+0(FP), R0 MOVD f+0(FP), R0
FMOVD R0, F0 FMOVD R0, F0
FRINTZD F0, F1 FRINTZD F0, F1
FMOVD F1, int+8(FP) FMOVD F1, int+8(FP)

View File

@ -7,7 +7,6 @@ package os_test
import ( import (
"bytes" "bytes"
"encoding/hex" "encoding/hex"
"fmt"
"internal/syscall/windows" "internal/syscall/windows"
"internal/testenv" "internal/testenv"
"io/ioutil" "io/ioutil"
@ -274,7 +273,7 @@ func TestDirectoryJunction(t *testing.T) {
mklink: func(link, target string) error { mklink: func(link, target string) error {
output, err := osexec.Command("cmd", "/c", "mklink", "/J", link, target).CombinedOutput() output, err := osexec.Command("cmd", "/c", "mklink", "/J", link, target).CombinedOutput()
if err != nil { 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 return nil
}, },
@ -346,7 +345,7 @@ func TestDirectorySymbolicLink(t *testing.T) {
mklink: func(link, target string) error { mklink: func(link, target string) error {
output, err := osexec.Command("cmd", "/c", "mklink", "/D", link, target).CombinedOutput() output, err := osexec.Command("cmd", "/c", "mklink", "/D", link, target).CombinedOutput()
if err != nil { 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 return nil
}, },

View File

@ -3119,7 +3119,7 @@ func ReadWriterV(x io.ReadWriter) Value {
type Empty struct{} type Empty struct{}
type MyStruct struct { type MyStruct struct {
x int "tag" x int `some:"tag"`
} }
type MyString string type MyString string
type MyBytes []byte type MyBytes []byte
@ -3434,31 +3434,31 @@ var convertTests = []struct {
// structs with different tags // structs with different tags
{V(struct { {V(struct {
x int "foo" x int `some:"foo"`
}{}), V(struct { }{}), V(struct {
x int "bar" x int `some:"bar"`
}{})}, }{})},
{V(struct { {V(struct {
x int "bar" x int `some:"bar"`
}{}), V(struct { }{}), V(struct {
x int "foo" x int `some:"foo"`
}{})}, }{})},
{V(MyStruct{}), V(struct { {V(MyStruct{}), V(struct {
x int "foo" x int `some:"foo"`
}{})}, }{})},
{V(struct { {V(struct {
x int "foo" x int `some:"foo"`
}{}), V(MyStruct{})}, }{}), V(MyStruct{})},
{V(MyStruct{}), V(struct { {V(MyStruct{}), V(struct {
x int "bar" x int `some:"bar"`
}{})}, }{})},
{V(struct { {V(struct {
x int "bar" x int `some:"bar"`
}{}), V(MyStruct{})}, }{}), V(MyStruct{})},
// can convert *byte and *MyByte // can convert *byte and *MyByte

View File

@ -1326,7 +1326,7 @@ func TestAddrOfIndex(t *testing.T) {
var buf bytes.Buffer var buf bytes.Buffer
err := tmpl.Execute(&buf, reflect.ValueOf([]V{{1}})) err := tmpl.Execute(&buf, reflect.ValueOf([]V{{1}}))
if err != nil { if err != nil {
t.Fatal("%s: Execute: %v", text, err) t.Fatalf("%s: Execute: %v", text, err)
} }
if buf.String() != "<1>" { if buf.String() != "<1>" {
t.Fatalf("%s: template output = %q, want %q", text, buf, "<1>") t.Fatalf("%s: template output = %q, want %q", text, buf, "<1>")