github.com/be-b10g/golangci-lint@v1.17.2/test/testdata/gochecknoglobals.go (about)

     1  //args: -Egochecknoglobals
     2  package testdata
     3  
     4  import (
     5  	"errors"
     6  	"fmt"
     7  )
     8  
     9  var noGlobalsVar int // ERROR "`noGlobalsVar` is a global variable"
    10  var ErrSomeType = errors.New("test that global erorrs aren't warned")
    11  
    12  func NoGlobals() {
    13  	fmt.Print(noGlobalsVar)
    14  }