1
0
mirror of https://github.com/mgechev/revive.git synced 2025-03-31 21:55:29 +02:00
revive/testdata/golint/error-strings-pkg-errors.go

19 lines
901 B
Go
Raw Normal View History

// Package foo ...
package foo
import (
"github.com/pkg/errors"
)
// Check for the error strings themselves.
func errorsStrings(x int) error {
var err error
err = errors.Wrap(err, "This %d is too low") // MATCH /error strings should not be capitalized or end with punctuation or a newline/
err = errors.New("This %d is too low") // MATCH /error strings should not be capitalized or end with punctuation or a newline/
err = errors.Wrapf(err, "This %d is too low", x) // MATCH /error strings should not be capitalized or end with punctuation or a newline/
err = errors.WithMessage(err, "This %d is too low") // MATCH /error strings should not be capitalized or end with punctuation or a newline/
err = errors.WithMessagef(err, "This %d is too low", x) // MATCH /error strings should not be capitalized or end with punctuation or a newline/
return err
}