github.com/songshiyun/revive@v1.1.5-0.20220323112655-f8433a19b3c5/testdata/golint/error-strings-pkg-errors.go (about)

     1  // Package foo ...
     2  package foo
     3  
     4  import (
     5  	"github.com/pkg/errors"
     6  )
     7  
     8  // Check for the error strings themselves.
     9  
    10  func errorsStrings(x int) error {
    11  	var err error
    12  	err = errors.Wrap(err, "This %d is too low")            // MATCH /error strings should not be capitalized or end with punctuation or a newline/
    13  	err = errors.New("This %d is too low")                  // MATCH /error strings should not be capitalized or end with punctuation or a newline/
    14  	err = errors.Wrapf(err, "This %d is too low", x)        // MATCH /error strings should not be capitalized or end with punctuation or a newline/
    15  	err = errors.WithMessage(err, "This %d is too low")     // MATCH /error strings should not be capitalized or end with punctuation or a newline/
    16  	err = errors.WithMessagef(err, "This %d is too low", x) // MATCH /error strings should not be capitalized or end with punctuation or a newline/
    17  	return err
    18  }