github.com/Johnny2210/revive@v1.0.8-0.20210625134200-febf37ccd0f5/testdata/golint/error-strings.go (about)

     1  // Package foo ...
     2  package foo
     3  
     4  import (
     5  	"errors"
     6  	"fmt"
     7  )
     8  
     9  // Check for the error strings themselves.
    10  
    11  func g(x int) error {
    12  	var err error
    13  	err = fmt.Errorf("This %d is too low", x)     // MATCH /error strings should not be capitalized or end with punctuation or a newline/
    14  	err = fmt.Errorf("XML time")                  // ok
    15  	err = fmt.Errorf("newlines are fun\n")        // MATCH /error strings should not be capitalized or end with punctuation or a newline/
    16  	err = fmt.Errorf("Newlines are really fun\n") // MATCH /error strings should not be capitalized or end with punctuation or a newline/
    17  	err = errors.New(`too much stuff.`)           // MATCH /error strings should not be capitalized or end with punctuation or a newline/
    18  	err = errors.New("This %d is too low", x)     // MATCH /error strings should not be capitalized or end with punctuation or a newline/
    19  	return err
    20  }