Commit eb8f2a83 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

all: fix vet nits

Fixes these complaints from vet:

cmd/compile/internal/gc/noder.go:32: cmd/compile/internal/syntax.Error composite literal uses unkeyed fields
cmd/compile/internal/gc/noder.go:1035: cmd/compile/internal/syntax.Error composite literal uses unkeyed fields
cmd/compile/internal/gc/noder.go:1051: cmd/compile/internal/syntax.Error composite literal uses unkeyed fields
cmd/compile/internal/syntax/parser_test.go:182: possible formatting directive in Error call
net/http/client_test.go:1334: possible formatting directive in Fatal call

Change-Id: I5f90ec30f3c106c7e66c92e2b6f8d3b4874fec66
Reviewed-on: https://go-review.googlesource.com/33133
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 50fed64d
...@@ -29,7 +29,7 @@ func parseFile(filename string) { ...@@ -29,7 +29,7 @@ func parseFile(filename string) {
if !imported_unsafe { if !imported_unsafe {
for _, x := range p.linknames { for _, x := range p.linknames {
p.error(syntax.Error{0, x, "//go:linkname only allowed in Go files that import \"unsafe\""}) p.error(syntax.Error{Line: x, Msg: "//go:linkname only allowed in Go files that import \"unsafe\""})
} }
} }
...@@ -1032,7 +1032,7 @@ func (p *noder) pragma(pos, line int, text string) syntax.Pragma { ...@@ -1032,7 +1032,7 @@ func (p *noder) pragma(pos, line int, text string) syntax.Pragma {
break break
} }
if n > 1e8 { if n > 1e8 {
p.error(syntax.Error{pos, line, "line number out of range"}) p.error(syntax.Error{Pos: pos, Line: line, Msg: "line number out of range"})
errorexit() errorexit()
} }
if n <= 0 { if n <= 0 {
...@@ -1048,7 +1048,7 @@ func (p *noder) pragma(pos, line int, text string) syntax.Pragma { ...@@ -1048,7 +1048,7 @@ func (p *noder) pragma(pos, line int, text string) syntax.Pragma {
f := strings.Fields(text) f := strings.Fields(text)
if len(f) != 3 { if len(f) != 3 {
p.error(syntax.Error{pos, line, "usage: //go:linkname localname linkname"}) p.error(syntax.Error{Pos: pos, Line: line, Msg: "usage: //go:linkname localname linkname"})
break break
} }
lookup(f[1]).Linkname = f[2] lookup(f[1]).Linkname = f[2]
......
...@@ -179,6 +179,6 @@ func TestParseFile(t *testing.T) { ...@@ -179,6 +179,6 @@ func TestParseFile(t *testing.T) {
t.Error("missing io error") t.Error("missing io error")
} }
if err != first { if err != first {
t.Error("got %v; want first error %v", err, first) t.Errorf("got %v; want first error %v", err, first)
} }
} }
...@@ -1331,7 +1331,7 @@ func TestClientTimeoutCancel(t *testing.T) { ...@@ -1331,7 +1331,7 @@ func TestClientTimeoutCancel(t *testing.T) {
cancel() cancel()
_, err = io.Copy(ioutil.Discard, res.Body) _, err = io.Copy(ioutil.Discard, res.Body)
if err != ExportErrRequestCanceled { if err != ExportErrRequestCanceled {
t.Fatal("error = %v; want errRequestCanceled") t.Fatalf("error = %v; want errRequestCanceled", err)
} }
} }
......
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