We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5e2b27 commit 36db75bCopy full SHA for 36db75b
loader/loader.go
@@ -52,7 +52,8 @@ type PackageJSON struct {
52
CFiles []string
53
54
// Dependency information
55
- Imports []string
+ Imports []string
56
+ ImportMap map[string]string
57
58
// Error information
59
Error *struct {
@@ -411,6 +412,9 @@ func (p *Package) Import(to string) (*types.Package, error) {
411
412
if to == "unsafe" {
413
return types.Unsafe, nil
414
}
415
+ if newTo, ok := p.ImportMap[to]; ok && !strings.HasSuffix(newTo, ".test]") {
416
+ to = newTo
417
+ }
418
if imported, ok := p.program.Packages[to]; ok {
419
return imported.Pkg, nil
420
} else {
0 commit comments