declImports reports whether gen contains an import of path.
(gen *ast.GenDecl, path string)
| 310 | |
| 311 | // declImports reports whether gen contains an import of path. |
| 312 | func declImports(gen *ast.GenDecl, path string) bool { |
| 313 | if gen.Tok != token.IMPORT { |
| 314 | return false |
| 315 | } |
| 316 | for _, spec := range gen.Specs { |
| 317 | impspec := spec.(*ast.ImportSpec) |
| 318 | if importPath(impspec) == path { |
| 319 | return true |
| 320 | } |
| 321 | } |
| 322 | return false |
| 323 | } |
| 324 | |
| 325 | // isPkgDot returns true if t is the expression "pkg.name" |
| 326 | // where pkg is an imported identifier. |
no test coverage detected