iperf3exporter/vendor/github.com/gostaticanalysis/analysisutil/file.go
Marvin Preuss 2343c9588a
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is failing
first commit
2021-10-20 10:08:56 +02:00

19 lines
300 B
Go

package analysisutil
import (
"go/ast"
"go/token"
"golang.org/x/tools/go/analysis"
)
// File finds *ast.File in pass.Files by pos.
func File(pass *analysis.Pass, pos token.Pos) *ast.File {
for _, f := range pass.Files {
if f.Pos() <= pos && pos <= f.End() {
return f
}
}
return nil
}