File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
pkg/golinters/revive/testdata Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -2580,6 +2580,8 @@ linters-settings:
25802580 severity : warning
25812581 disabled : false
25822582 exclude : [""]
2583+ arguments :
2584+ - " xerrors.New"
25832585 # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#errorf
25842586 - name : errorf
25852587 severity : warning
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ package testdata
55import (
66 "net/http"
77 "time"
8+
9+ "golang.org/x/xerrors"
810)
911
1012func SampleRevive (t * time.Duration ) error {
@@ -28,3 +30,7 @@ func testReviveComplexity(s string) { // want "cyclomatic: function testReviveCo
2830 return
2931 }
3032}
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:
1717 arguments : [ 10 ]
1818 - name : max-public-structs
1919 arguments : [ 3 ]
20+ - name : error-strings
21+ arguments :
22+ - " xerrors.New"
You can’t perform that action at this time.
0 commit comments