github.com/amarpal/go-tools@v0.0.0-20240422043104-40142f59f616/analysis/facts/directives/directives.go (about) 1 package directives 2 3 import ( 4 "reflect" 5 6 "github.com/amarpal/go-tools/analysis/lint" 7 "golang.org/x/tools/go/analysis" 8 ) 9 10 func directives(pass *analysis.Pass) (interface{}, error) { 11 return lint.ParseDirectives(pass.Files, pass.Fset), nil 12 } 13 14 var Analyzer = &analysis.Analyzer{ 15 Name: "directives", 16 Doc: "extracts linter directives", 17 Run: directives, 18 RunDespiteErrors: true, 19 ResultType: reflect.TypeOf([]lint.Directive{}), 20 }