(importedFrom, importedPath string)
| 123 | } |
| 124 | |
| 125 | func (cache *importCache) importData(importedFrom, importedPath string) (contents Contents, foundAt string, err error) { |
| 126 | contents, foundAt, err = cache.importer.Import(importedFrom, importedPath) |
| 127 | if err != nil { |
| 128 | return Contents{}, "", err |
| 129 | } |
| 130 | if cached, importedBefore := cache.foundAtVerification[foundAt]; importedBefore { |
| 131 | if cached != contents { |
| 132 | panic(fmt.Sprintf("importer problem: a different instance of Contents returned when importing %#v again", foundAt)) |
| 133 | } |
| 134 | } else { |
| 135 | cache.foundAtVerification[foundAt] = contents |
| 136 | } |
| 137 | return |
| 138 | } |
| 139 | |
| 140 | func (cache *importCache) importAST(importedFrom, importedPath string) (ast.Node, string, error) { |
| 141 | contents, foundAt, err := cache.importData(importedFrom, importedPath) |
no test coverage detected