Skip to content

Commit

Permalink
t.Error doesn't return a value (#285)
Browse files Browse the repository at this point in the history
Go compiler would complain about using void-result
function value as a return expression.
  • Loading branch information
quasilyte authored and mgechev committed Dec 25, 2019
1 parent f19d717 commit 99d1f99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fixtures/golint/errorf.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ func f(x int) error {
func TestF(t *testing.T) error {
x := 1
if x > 10 {
return t.Error(fmt.Sprintf("something %d", x)) // MATCH /should replace t.Error(fmt.Sprintf(...)) with t.Errorf(...)/
t.Error(fmt.Sprintf("something %d", x)) // MATCH /should replace t.Error(fmt.Sprintf(...)) with t.Errorf(...)/
}
if x > 5 {
return t.Error(g("blah")) // ok
t.Error(g("blah")) // ok
}
if x > 4 {
return t.Error("something else") // ok
t.Error("something else") // ok
}
return nil
}
Expand Down

0 comments on commit 99d1f99

Please sign in to comment.