Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
fa7791e9
Commit
fa7791e9
authored
Sep 27, 2013
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: fix some mistakes found by go tool vet .
R=golang-dev, iant, adg CC=golang-dev
https://golang.org/cl/14000043
parent
1f7c8a9a
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
15 additions
and
16 deletions
+15
-16
src/pkg/encoding/gob/encoder_test.go
src/pkg/encoding/gob/encoder_test.go
+1
-1
src/pkg/encoding/gob/gobencdec_test.go
src/pkg/encoding/gob/gobencdec_test.go
+1
-1
src/pkg/math/big/int_test.go
src/pkg/math/big/int_test.go
+1
-1
src/pkg/net/http/header_test.go
src/pkg/net/http/header_test.go
+1
-1
src/pkg/net/http/request_test.go
src/pkg/net/http/request_test.go
+1
-1
src/pkg/net/http/serve_test.go
src/pkg/net/http/serve_test.go
+1
-1
src/pkg/net/ip_test.go
src/pkg/net/ip_test.go
+1
-1
src/pkg/net/timeout_test.go
src/pkg/net/timeout_test.go
+1
-1
src/pkg/regexp/all_test.go
src/pkg/regexp/all_test.go
+4
-4
src/pkg/regexp/syntax/parse_test.go
src/pkg/regexp/syntax/parse_test.go
+1
-1
src/pkg/runtime/crash_test.go
src/pkg/runtime/crash_test.go
+1
-2
src/pkg/runtime/mfinal_test.go
src/pkg/runtime/mfinal_test.go
+1
-1
No files found.
src/pkg/encoding/gob/encoder_test.go
View file @
fa7791e9
...
...
@@ -687,7 +687,7 @@ func TestChanFuncIgnored(t *testing.T) {
t
.
Fatal
(
"decode:"
,
err
)
}
if
b1
.
A
!=
b0
.
A
{
t
.
Fatal
(
"got %d want %d"
,
b1
.
A
,
b0
.
A
)
t
.
Fatal
f
(
"got %d want %d"
,
b1
.
A
,
b0
.
A
)
}
if
b1
.
C
!=
nil
||
b1
.
CP
!=
nil
||
b1
.
F
!=
nil
||
b1
.
FPP
!=
nil
{
t
.
Fatal
(
"unexpected value for chan or func"
)
...
...
src/pkg/encoding/gob/gobencdec_test.go
View file @
fa7791e9
...
...
@@ -428,7 +428,7 @@ func TestGobEncoderValueEncoder(t *testing.T) {
t
.
Fatal
(
"decode error:"
,
err
)
}
if
*
x
.
V
!=
"hello"
||
*
x
.
BV
!=
"Καλημέρα"
||
*
x
.
TV
!=
"こんにちは"
{
t
.
Errorf
(
"expected `hello` got %s"
,
x
.
V
)
t
.
Errorf
(
"expected `hello` got %s"
,
*
x
.
V
)
}
}
...
...
src/pkg/math/big/int_test.go
View file @
fa7791e9
...
...
@@ -89,7 +89,7 @@ func testFunZZ(t *testing.T, msg string, f funZZ, a argZZ) {
var
z
Int
f
(
&
z
,
a
.
x
,
a
.
y
)
if
!
isNormalized
(
&
z
)
{
t
.
Errorf
(
"%s%v is not normalized"
,
z
,
msg
)
t
.
Errorf
(
"%s%v is not normalized"
,
msg
,
z
)
}
if
(
&
z
)
.
Cmp
(
a
.
z
)
!=
0
{
t
.
Errorf
(
"%s%+v
\n\t
got z = %v; want %v"
,
msg
,
a
,
&
z
,
a
.
z
)
...
...
src/pkg/net/http/header_test.go
View file @
fa7791e9
...
...
@@ -204,6 +204,6 @@ func TestHeaderWriteSubsetMallocs(t *testing.T) {
testHeader
.
WriteSubset
(
&
buf
,
nil
)
})
if
n
>
0
{
t
.
Errorf
(
"mallocs = %
d
; want 0"
,
n
)
t
.
Errorf
(
"mallocs = %
g
; want 0"
,
n
)
}
}
src/pkg/net/http/request_test.go
View file @
fa7791e9
...
...
@@ -332,7 +332,7 @@ func TestRequestWriteBufferedWriter(t *testing.T) {
func
testMissingFile
(
t
*
testing
.
T
,
req
*
Request
)
{
f
,
fh
,
err
:=
req
.
FormFile
(
"missing"
)
if
f
!=
nil
{
t
.
Errorf
(
"FormFile file = %
q
, want nil"
,
f
)
t
.
Errorf
(
"FormFile file = %
v
, want nil"
,
f
)
}
if
fh
!=
nil
{
t
.
Errorf
(
"FormFile file header = %q, want nil"
,
fh
)
...
...
src/pkg/net/http/serve_test.go
View file @
fa7791e9
...
...
@@ -1987,7 +1987,7 @@ func TestHTTP10ConnectionHeader(t *testing.T) {
got
:=
resp
.
Header
[
"Connection"
]
if
!
reflect
.
DeepEqual
(
got
,
tt
.
expect
)
{
t
.
Errorf
(
"wrong Connection headers for request %q. Got %q expect %q"
,
got
,
tt
.
expect
)
t
.
Errorf
(
"wrong Connection headers for request %q. Got %q expect %q"
,
tt
.
req
,
got
,
tt
.
expect
)
}
}
}
...
...
src/pkg/net/ip_test.go
View file @
fa7791e9
...
...
@@ -85,7 +85,7 @@ func TestIPString(t *testing.T) {
}
}
if
out
,
err
:=
tt
.
in
.
MarshalText
();
string
(
out
)
!=
tt
.
out
||
err
!=
nil
{
t
.
Errorf
(
"IP.MarshalText(%v) = %q, %v, want %q, nil"
,
out
,
err
,
tt
.
out
)
t
.
Errorf
(
"IP.MarshalText(%v) = %q, %v, want %q, nil"
,
tt
.
in
,
out
,
err
,
tt
.
out
)
}
}
}
...
...
src/pkg/net/timeout_test.go
View file @
fa7791e9
...
...
@@ -549,7 +549,7 @@ func TestReadDeadlineDataAvailable(t *testing.T) {
}
defer
c
.
Close
()
if
res
:=
<-
servec
;
res
.
err
!=
nil
||
res
.
n
!=
int64
(
len
(
msg
))
{
t
.
Fatalf
(
"unexpected server Write: n=%d, err=%
d
; want n=%d, err=nil"
,
res
.
n
,
res
.
err
,
len
(
msg
))
t
.
Fatalf
(
"unexpected server Write: n=%d, err=%
v
; want n=%d, err=nil"
,
res
.
n
,
res
.
err
,
len
(
msg
))
}
c
.
SetReadDeadline
(
time
.
Now
()
.
Add
(
-
5
*
time
.
Second
))
// in the psat.
buf
:=
make
([]
byte
,
len
(
msg
)
/
2
)
...
...
src/pkg/regexp/all_test.go
View file @
fa7791e9
...
...
@@ -308,14 +308,14 @@ func TestReplaceAllFunc(t *testing.T) {
}
actual
:=
re
.
ReplaceAllStringFunc
(
tc
.
input
,
tc
.
replacement
)
if
actual
!=
tc
.
output
{
t
.
Errorf
(
"%q.ReplaceFunc(%q,
%q
) = %q; want %q"
,
tc
.
pattern
,
tc
.
input
,
tc
.
replacement
,
actual
,
tc
.
output
)
t
.
Errorf
(
"%q.ReplaceFunc(%q,
fn
) = %q; want %q"
,
tc
.
pattern
,
tc
.
input
,
actual
,
tc
.
output
)
}
// now try bytes
actual
=
string
(
re
.
ReplaceAllFunc
([]
byte
(
tc
.
input
),
func
(
s
[]
byte
)
[]
byte
{
return
[]
byte
(
tc
.
replacement
(
string
(
s
)))
}))
if
actual
!=
tc
.
output
{
t
.
Errorf
(
"%q.ReplaceFunc(%q,
%q
) = %q; want %q"
,
tc
.
pattern
,
tc
.
input
,
tc
.
replacement
,
actual
,
tc
.
output
)
t
.
Errorf
(
"%q.ReplaceFunc(%q,
fn
) = %q; want %q"
,
tc
.
pattern
,
tc
.
input
,
actual
,
tc
.
output
)
}
}
}
...
...
src/pkg/regexp/syntax/parse_test.go
View file @
fa7791e9
...
...
@@ -542,7 +542,7 @@ func TestToStringEquivalentParse(t *testing.T) {
// but "{" is a shorter equivalent in some contexts.
nre
,
err
:=
Parse
(
s
,
testFlags
)
if
err
!=
nil
{
t
.
Errorf
(
"Parse(%#q.String() = %#q): %v"
,
tt
.
Regexp
,
t
,
err
)
t
.
Errorf
(
"Parse(%#q.String() = %#q): %v"
,
tt
.
Regexp
,
s
,
err
)
continue
}
nd
:=
dump
(
nre
)
...
...
src/pkg/runtime/crash_test.go
View file @
fa7791e9
...
...
@@ -111,9 +111,8 @@ func TestLockedDeadlock2(t *testing.T) {
func
TestGoexitDeadlock
(
t
*
testing
.
T
)
{
output
:=
executeTest
(
t
,
goexitDeadlockSource
,
nil
)
want
:=
""
if
output
!=
""
{
t
.
Fatalf
(
"expected no output
:
\n
%s"
,
want
,
output
)
t
.
Fatalf
(
"expected no output
, got:
\n
%s"
,
output
)
}
}
...
...
src/pkg/runtime/mfinal_test.go
View file @
fa7791e9
...
...
@@ -80,7 +80,7 @@ func TestFinalizerInterfaceBig(t *testing.T) {
t
.
Errorf
(
"Expected *bigValue from interface{} in finalizer, got %v"
,
*
i
)
}
if
i
.
fill
!=
0xDEADBEEFDEADBEEF
&&
i
.
it
!=
true
&&
i
.
up
!=
"It matters not how strait the gate"
{
t
.
Errorf
(
"*bigValue from interface{} has the wrong value: %
d
\n
"
,
*
i
)
t
.
Errorf
(
"*bigValue from interface{} has the wrong value: %
v
\n
"
,
*
i
)
}
close
(
ch
)
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment