Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / stylecheck / testdata / src / CheckErrorStrings / CheckErrorStrings.go
1 // Package pkg ...
2 package pkg
3
4 import "errors"
5
6 func fn() {
7         errors.New("a perfectly fine error")
8         errors.New("Not a great error")       // want `error strings should not be capitalized`
9         errors.New("also not a great error.") // want `error strings should not end with punctuation or a newline`
10         errors.New("URL is okay")
11         errors.New("SomeFunc is okay")
12         errors.New("URL is okay, but the period is not.") // want `error strings should not end with punctuation or a newline`
13         errors.New("T must not be nil")
14 }
15
16 func Write() {
17         errors.New("Write: this is broken")
18 }
19
20 type T struct{}
21
22 func (T) Read() {
23         errors.New("Read: this is broken")
24         errors.New("Read failed")
25 }
26
27 func fn2() {
28         // The error string hasn't to be in the same function
29         errors.New("Read failed")
30 }