Decl deduction failed, but we're on " .", this ident can be an unexported package, let's try to match the ident against a set of known packages and if it matches try to import it. TODO: Right now I've made a static list of built-in packages, but in theory we could scan all GOPATH packages as w
(ident string, filename string, context *package_lookup_context)
| 421 | // scan the packages. And many of them will have conflicts. Can we make a smart |
| 422 | // prediction algorithm which will prefer certain packages over another ones? |
| 423 | func resolveKnownPackageIdent(ident string, filename string, context *package_lookup_context) *package_file_cache { |
| 424 | importPath, ok := knownPackageIdents[ident] |
| 425 | if !ok { |
| 426 | return nil |
| 427 | } |
| 428 | |
| 429 | path, ok := abs_path_for_package(filename, importPath, context) |
| 430 | if !ok { |
| 431 | return nil |
| 432 | } |
| 433 | |
| 434 | p := new_package_file_cache(path, importPath) |
| 435 | p.update_cache() |
| 436 | return p |
| 437 | } |
| 438 | |
| 439 | var knownPackageIdents = map[string]string{ |
| 440 | "adler32": "hash/adler32", |
no test coverage detected