lookupAstFromFile attempts to find the file ast for a given file (token.File) nilable(result 0)
(pass *analysishelper.EnhancedPass, file *token.File)
| 447 | // lookupAstFromFile attempts to find the file ast for a given file (token.File) |
| 448 | // nilable(result 0) |
| 449 | func lookupAstFromFile(pass *analysishelper.EnhancedPass, file *token.File) *ast.File { |
| 450 | for _, astFile := range pass.Files { |
| 451 | if file != nil && int(astFile.Pos()) >= file.Base() && int(astFile.Pos()) <= file.Base()+file.Size() { |
| 452 | return astFile |
| 453 | } |
| 454 | } |
| 455 | return nil |
| 456 | } |
| 457 | |
| 458 | // lookupAstFromFilename attempts to find the file ast for a given file (token.File) |
| 459 | // nilable(result 0) |
no test coverage detected