Skip to content

Commit f9fff45

Browse files
ainar-ggriesemer
authored andcommitted
go/build, go/doc: fix tautological conditions
These issues were found by the new vet's nilness check. The variables were already checked against nil, so remove extra checks. Change-Id: Ie252ccfcc755f3d06f691f354bf13d5a623fe17b Reviewed-on: https://go-review.googlesource.com/c/148937 Reviewed-by: Robert Griesemer <[email protected]> Run-TryBot: Robert Griesemer <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 8e0ec5e commit f9fff45

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/go/build/read_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func testRead(t *testing.T, tests []readTest, read func(io.Reader) ([]byte, erro
118118
}
119119
continue
120120
}
121-
if err == nil && tt.err != "" {
121+
if tt.err != "" {
122122
t.Errorf("#%d: success, expected %q", i, tt.err)
123123
continue
124124
}

src/go/doc/reader.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (mset methodSet) add(m *Func) {
8181
mset[m.Name] = m
8282
return
8383
}
84-
if old != nil && m.Level == old.Level {
84+
if m.Level == old.Level {
8585
// conflict - mark it using a method with nil Decl
8686
mset[m.Name] = &Func{
8787
Name: m.Name,

0 commit comments

Comments
 (0)