1
0
mirror of https://github.com/mgechev/revive.git synced 2024-12-10 10:40:23 +02:00
revive/testdata/golint/error-strings-pkg-errors.go
doniacld 0fada9d76c
Update error-strings rule (#608) (#609)
Co-authored-by: SalvadorC <salvadorcavadini+github@gmail.com>
2021-10-28 21:26:02 +02:00

19 lines
901 B
Go

// 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
}