@@ -26,17 +26,12 @@ func TestReviveLint(t *testing.T) {
26
26
failureList = append (failureList , failure )
27
27
}
28
28
29
- const expected = 3
29
+ const expected = 5
30
30
31
31
got := len (failureList )
32
32
if got != expected {
33
33
t .Fatalf ("Expected failures to have %d failures, but it has %d." , expected , got )
34
34
}
35
-
36
- errmsg := "redundant if ...; err != nil check, just return error instead."
37
- if failureList [0 ].Failure != errmsg {
38
- t .Fatalf ("Expected failure[0] to be '%s', but it was '%s'" , errmsg , failureList [0 ].Failure )
39
- }
40
35
}
41
36
42
37
func TestReviveFormat (t * testing.T ) {
@@ -57,13 +52,15 @@ func TestReviveFormat(t *testing.T) {
57
52
}
58
53
59
54
errorMsgs := []string {
60
- "(15, 2) https://revive.run/r#if-return redundant if ...; err != nil check, just return error instead." ,
61
- "(88, 3) https://revive.run/r#if-return redundant if ...; err != nil check, just return error instead." ,
62
- "(95, 3) https://revive.run/r#if-return redundant if ...; err != nil check, just return error instead." ,
55
+ "(91, 3) https://revive.run/r#unreachable-code unreachable code after this statement" ,
56
+ "(98, 3) https://revive.run/r#unreachable-code unreachable code after this statement" ,
57
+ "(15, 2) https://revive.run/r#if-return redundant if ...; err != nil check, just return error instead." ,
58
+ "(88, 3) https://revive.run/r#if-return redundant if ...; err != nil check, just return error instead." ,
59
+ "(95, 3) https://revive.run/r#if-return redundant if ...; err != nil check, just return error instead." ,
63
60
}
64
61
for _ , errorMsg := range errorMsgs {
65
62
if ! strings .Contains (failures , errorMsg ) {
66
- t .Fatalf ("Expected formatted failures '%s' to contain '%s', but it didn't." , failures , errorMsg )
63
+ t .Fatalf ("Expected formatted failures\n '%s'\n to contain\n '%s', but it didn't." , failures , errorMsg )
67
64
}
68
65
}
69
66
0 commit comments