aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modload/import.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2021-04-30 01:51:16 -0400
committerBryan C. Mills <bcmills@google.com>2021-04-30 18:14:41 +0000
commitd9bfda81249f25959090b1493ac8e261dd4542f4 (patch)
treefc7e9796e0d5b19708f69d5cd1e54daef57e9e8c /src/cmd/go/internal/modload/import.go
parentcbff713e68a1378713f1692cbfe13499106de7eb (diff)
downloadgo-d9bfda81249f25959090b1493ac8e261dd4542f4.tar.gz
go-d9bfda81249f25959090b1493ac8e261dd4542f4.zip
cmd/go: remove the special case for "unsafe" in importFromModules
The comment for this special case claims: > There's no directory for import "C" or import "unsafe". However, there clearly is a directory for "unsafe" in GOROOT/src/unsafe, and all of our integration tests seem to pass without this special case. As far as I can tell, it's just confusing. Also note that the internal/goroot package explicitly considers package "unsafe" to be in the standard library; see CL 137435. For #36460 Change-Id: Ib857d18f731a7f3c911c1bd116a34e3a9b3d74a5 Reviewed-on: https://go-review.googlesource.com/c/go/+/315412 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
Diffstat (limited to 'src/cmd/go/internal/modload/import.go')
-rw-r--r--src/cmd/go/internal/modload/import.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/go/internal/modload/import.go b/src/cmd/go/internal/modload/import.go
index 6c863351ff..f76befcfe3 100644
--- a/src/cmd/go/internal/modload/import.go
+++ b/src/cmd/go/internal/modload/import.go
@@ -243,8 +243,8 @@ func importFromModules(ctx context.Context, path string, rs *Requirements, mg *M
if build.IsLocalImport(path) {
return module.Version{}, "", fmt.Errorf("relative import not supported")
}
- if path == "C" || path == "unsafe" {
- // There's no directory for import "C" or import "unsafe".
+ if path == "C" {
+ // There's no directory for import "C".
return module.Version{}, "", nil
}
// Before any further lookup, check that the path is valid.