File tree 3 files changed +11
-0
lines changed
pkg/golinters/revive/testdata
3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -2580,6 +2580,8 @@ linters-settings:
2580
2580
severity : warning
2581
2581
disabled : false
2582
2582
exclude : [""]
2583
+ arguments :
2584
+ - " xerrors.New"
2583
2585
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#errorf
2584
2586
- name : errorf
2585
2587
severity : warning
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ package testdata
5
5
import (
6
6
"net/http"
7
7
"time"
8
+
9
+ "golang.org/x/xerrors"
8
10
)
9
11
10
12
func SampleRevive (t * time.Duration ) error {
@@ -28,3 +30,7 @@ func testReviveComplexity(s string) { // want "cyclomatic: function testReviveCo
28
30
return
29
31
}
30
32
}
33
+
34
+ func testErrorStrings () {
35
+ _ = xerrors .New ("Some error!" ) // want "error strings should not be capitalized or end with punctuation or a newline"
36
+ }
Original file line number Diff line number Diff line change @@ -17,3 +17,6 @@ linters-settings:
17
17
arguments : [ 10 ]
18
18
- name : max-public-structs
19
19
arguments : [ 3 ]
20
+ - name : error-strings
21
+ arguments :
22
+ - " xerrors.New"
You can’t perform that action at this time.
0 commit comments