Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / facts / token.go
1 package facts
2
3 import (
4         "go/ast"
5         "go/token"
6         "reflect"
7
8         "golang.org/x/tools/go/analysis"
9 )
10
11 var TokenFile = &analysis.Analyzer{
12         Name: "tokenfileanalyzer",
13         Doc:  "creates a mapping of *token.File to *ast.File",
14         Run: func(pass *analysis.Pass) (interface{}, error) {
15                 m := map[*token.File]*ast.File{}
16                 for _, af := range pass.Files {
17                         tf := pass.Fset.File(af.Pos())
18                         m[tf] = af
19                 }
20                 return m, nil
21         },
22         RunDespiteErrors: true,
23         ResultType:       reflect.TypeOf(map[*token.File]*ast.File{}),
24 }