50fbc2eec2
* CI: use staticcheck for linting This commit switches the linter for Go code from golint to staticcheck. Golint has been deprecated since last year and staticcheck is a recommended replacement. Signed-off-by: Lucas Servén Marín <lserven@gmail.com> * revendor Signed-off-by: Lucas Servén Marín <lserven@gmail.com> * cmd,pkg: fix lint warnings Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
21 lines
461 B
Go
21 lines
461 B
Go
package facts
|
|
|
|
import (
|
|
"reflect"
|
|
|
|
"golang.org/x/tools/go/analysis"
|
|
"honnef.co/go/tools/analysis/lint"
|
|
)
|
|
|
|
func directives(pass *analysis.Pass) (interface{}, error) {
|
|
return lint.ParseDirectives(pass.Files, pass.Fset), nil
|
|
}
|
|
|
|
var Directives = &analysis.Analyzer{
|
|
Name: "directives",
|
|
Doc: "extracts linter directives",
|
|
Run: directives,
|
|
RunDespiteErrors: true,
|
|
ResultType: reflect.TypeOf([]lint.Directive{}),
|
|
}
|