diff --git a/go/loader/loader.go b/go/loader/loader.go index b0f8336c..23cb68c6 100644 --- a/go/loader/loader.go +++ b/go/loader/loader.go @@ -711,7 +711,7 @@ func (conf *Config) build() *build.Context { // 'x': include external *_test.go source files. (XTestGoFiles) // func (conf *Config) parsePackageFiles(bp *build.Package, which rune) ([]*ast.File, []error) { - if bp.Goroot && bp.ImportPath == "unsafe" { + if bp.ImportPath == "unsafe" { return nil, nil } var filenames []string @@ -767,7 +767,7 @@ func (imp *importer) doImport(from *PackageInfo, to string) (*types.Package, err // The standard unsafe package is handled specially, // and has no PackageInfo. - if bp.Goroot && bp.ImportPath == "unsafe" { + if bp.ImportPath == "unsafe" { return types.Unsafe, nil } diff --git a/go/loader/loader14.go b/go/loader/loader14.go index d3fb1571..4fd4b2a6 100644 --- a/go/loader/loader14.go +++ b/go/loader/loader14.go @@ -714,7 +714,7 @@ func (conf *Config) build() *build.Context { // 'x': include external *_test.go source files. (XTestGoFiles) // func (conf *Config) parsePackageFiles(bp *build.Package, which rune) ([]*ast.File, []error) { - if bp.Goroot && bp.ImportPath == "unsafe" { + if bp.ImportPath == "unsafe" { return nil, nil } var filenames []string @@ -770,7 +770,7 @@ func (imp *importer) doImport(from *PackageInfo, to string) (*types.Package, err // The standard unsafe package is handled specially, // and has no PackageInfo. - if bp.Goroot && bp.ImportPath == "unsafe" { + if bp.ImportPath == "unsafe" { return types.Unsafe, nil }