honnef.co/go/tools@v0.5.0-0.dev.0.20240520180541-dcae280a5e87/analysis/facts/directives/directives.go (about) 1 package directives 2 3 import ( 4 "reflect" 5 6 "golang.org/x/tools/go/analysis" 7 "honnef.co/go/tools/analysis/lint" 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 }