1
0
mirror of https://github.com/golang/go synced 2024-11-12 10:20:27 -07:00

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 <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Ainar Garipov 2018-11-09 23:28:54 +03:00 committed by Robert Griesemer
parent 8e0ec5ec09
commit f9fff4554c
2 changed files with 2 additions and 2 deletions

View File

@ -118,7 +118,7 @@ func testRead(t *testing.T, tests []readTest, read func(io.Reader) ([]byte, erro
}
continue
}
if err == nil && tt.err != "" {
if tt.err != "" {
t.Errorf("#%d: success, expected %q", i, tt.err)
continue
}

View File

@ -81,7 +81,7 @@ func (mset methodSet) add(m *Func) {
mset[m.Name] = m
return
}
if old != nil && m.Level == old.Level {
if m.Level == old.Level {
// conflict - mark it using a method with nil Decl
mset[m.Name] = &Func{
Name: m.Name,