diff --git a/go.mod b/go.mod index 7d5ee98e13b1..cdfc1b309b2a 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( 4d63.com/gochecknoglobals v0.2.1 github.com/4meepo/tagalign v1.3.4 github.com/Abirdcfly/dupword v0.1.1 - github.com/Antonboom/errname v0.1.13 + github.com/Antonboom/errname v1.0.0 github.com/Antonboom/nilnil v0.1.9 github.com/Antonboom/testifylint v1.5.0 github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c diff --git a/go.sum b/go.sum index 08a01581b754..53887a10fec6 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,8 @@ github.com/4meepo/tagalign v1.3.4 h1:P51VcvBnf04YkHzjfclN6BbsopfJR5rxs1n+5zHt+w8 github.com/4meepo/tagalign v1.3.4/go.mod h1:M+pnkHH2vG8+qhE5bVc/zeP7HS/j910Fwa9TUSyZVI0= github.com/Abirdcfly/dupword v0.1.1 h1:Bsxe0fIw6OwBtXMIncaTxCLHYO5BB+3mcsR5E8VXloY= github.com/Abirdcfly/dupword v0.1.1/go.mod h1:B49AcJdTYYkpd4HjgAcutNGG9HZ2JWwKunH9Y2BA6sM= -github.com/Antonboom/errname v0.1.13 h1:JHICqsewj/fNckzrfVSe+T33svwQxmjC+1ntDsHOVvM= -github.com/Antonboom/errname v0.1.13/go.mod h1:uWyefRYRN54lBg6HseYCFhs6Qjcy41Y3Jl/dVhA87Ns= +github.com/Antonboom/errname v1.0.0 h1:oJOOWR07vS1kRusl6YRSlat7HFnb3mSfMl6sDMRoTBA= +github.com/Antonboom/errname v1.0.0/go.mod h1:gMOBFzK/vrTiXN9Oh+HFs+e6Ndl0eTFbtsRTSRdXyGI= github.com/Antonboom/nilnil v0.1.9 h1:eKFMejSxPSA9eLSensFmjW2XTgTwJMjZ8hUHtV4s/SQ= github.com/Antonboom/nilnil v0.1.9/go.mod h1:iGe2rYwCq5/Me1khrysB4nwI7swQvjclR8/YRPl5ihQ= github.com/Antonboom/testifylint v1.5.0 h1:dlUIsDMtCrZWUnvkaCz3quJCoIjaGi41GzjPBGkkJ8A= diff --git a/pkg/golinters/errname/testdata/errname.go b/pkg/golinters/errname/testdata/errname.go index d206ffc498a6..8e23e36d0eec 100644 --- a/pkg/golinters/errname/testdata/errname.go +++ b/pkg/golinters/errname/testdata/errname.go @@ -11,11 +11,11 @@ var ( ErrEndOfFile = errors.New("end of file") errEndOfFile = errors.New("end of file") - EndOfFileError = errors.New("end of file") // want "the variable name `EndOfFileError` should conform to the `ErrXxx` format" - ErrorEndOfFile = errors.New("end of file") // want "the variable name `ErrorEndOfFile` should conform to the `ErrXxx` format" - EndOfFileErr = errors.New("end of file") // want "the variable name `EndOfFileErr` should conform to the `ErrXxx` format" - endOfFileError = errors.New("end of file") // want "the variable name `endOfFileError` should conform to the `errXxx` format" - errorEndOfFile = errors.New("end of file") // want "the variable name `errorEndOfFile` should conform to the `errXxx` format" + EndOfFileError = errors.New("end of file") // want "the sentinel error name `EndOfFileError` should conform to the `ErrXxx` format" + ErrorEndOfFile = errors.New("end of file") // want "the sentinel error name `ErrorEndOfFile` should conform to the `ErrXxx` format" + EndOfFileErr = errors.New("end of file") // want "the sentinel error name `EndOfFileErr` should conform to the `ErrXxx` format" + endOfFileError = errors.New("end of file") // want "the sentinel error name `endOfFileError` should conform to the `errXxx` format" + errorEndOfFile = errors.New("end of file") // want "the sentinel error name `errorEndOfFile` should conform to the `errXxx` format" ) const maxSize = 256 @@ -24,8 +24,8 @@ var ( ErrOutOfSize = fmt.Errorf("out of size (max %d)", maxSize) errOutOfSize = fmt.Errorf("out of size (max %d)", maxSize) - OutOfSizeError = fmt.Errorf("out of size (max %d)", maxSize) // want "the variable name `OutOfSizeError` should conform to the `ErrXxx` format" - outOfSizeError = fmt.Errorf("out of size (max %d)", maxSize) // want "the variable name `outOfSizeError` should conform to the `errXxx` format" + OutOfSizeError = fmt.Errorf("out of size (max %d)", maxSize) // want "the sentinel error name `OutOfSizeError` should conform to the `ErrXxx` format" + outOfSizeError = fmt.Errorf("out of size (max %d)", maxSize) // want "the sentinel error name `outOfSizeError` should conform to the `errXxx` format" ) func errInsideFuncIsNotSentinel() error { @@ -42,14 +42,14 @@ type DNSConfigError struct{} func (D DNSConfigError) Error() string { return "DNS config error" } -type someTypeWithoutPtr struct{} // want "the type name `someTypeWithoutPtr` should conform to the `xxxError` format" +type someTypeWithoutPtr struct{} // want "the error type name `someTypeWithoutPtr` should conform to the `xxxError` format" func (s someTypeWithoutPtr) Error() string { return "someTypeWithoutPtr" } -type SomeTypeWithoutPtr struct{} // want "the type name `SomeTypeWithoutPtr` should conform to the `XxxError` format" +type SomeTypeWithoutPtr struct{} // want "the error type name `SomeTypeWithoutPtr` should conform to the `XxxError` format" func (s SomeTypeWithoutPtr) Error() string { return "SomeTypeWithoutPtr" } -type someTypeWithPtr struct{} // want "the type name `someTypeWithPtr` should conform to the `xxxError` format" +type someTypeWithPtr struct{} // want "the error type name `someTypeWithPtr` should conform to the `xxxError` format" func (s *someTypeWithPtr) Error() string { return "someTypeWithPtr" } -type SomeTypeWithPtr struct{} // want "the type name `SomeTypeWithPtr` should conform to the `XxxError` format" +type SomeTypeWithPtr struct{} // want "the error type name `SomeTypeWithPtr` should conform to the `XxxError` format" func (s *SomeTypeWithPtr) Error() string { return "SomeTypeWithPtr" }