diff options
author | Jay Conrod <jayconrod@google.com> | 2020-09-17 15:54:13 -0400 |
---|---|---|
committer | Jay Conrod <jayconrod@google.com> | 2020-09-17 20:57:33 +0000 |
commit | 9a702fd427645e4bcd42a68f9676bc1ab2adb6e4 (patch) | |
tree | a61134c1b16f4fff66863c1225ef6a2f79e2fc70 /src/cmd/go/internal/modload/import.go | |
parent | e6426dfd6dbc47ba23b8a91003b8f947c5afa692 (diff) | |
download | go-9a702fd427645e4bcd42a68f9676bc1ab2adb6e4.tar.gz go-9a702fd427645e4bcd42a68f9676bc1ab2adb6e4.zip |
cmd/go: flip relationship between load and modload
Previously, modload imported load, but it mainly just did so in order
to install callbacks to the modload API. This was important during vgo
development, but there's no longer a strong reason to do this. Nothing
modload imports strongly depends on load, so there's little danger of
a dependency cycle.
This change deletes the callbacks in load and instead, makes load call
exported functions in modload directly. In the future, these functions
may have different signatures than their GOPATH counterparts.
Change-Id: Ifde5c3ffebd190b5bd184924ec447d272b936f27
Reviewed-on: https://go-review.googlesource.com/c/go/+/255719
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/modload/import.go')
-rw-r--r-- | src/cmd/go/internal/modload/import.go | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/cmd/go/internal/modload/import.go b/src/cmd/go/internal/modload/import.go index 10b1e7f4b8..e93eebcb81 100644 --- a/src/cmd/go/internal/modload/import.go +++ b/src/cmd/go/internal/modload/import.go @@ -17,7 +17,6 @@ import ( "time" "cmd/go/internal/cfg" - "cmd/go/internal/load" "cmd/go/internal/modfetch" "cmd/go/internal/par" "cmd/go/internal/search" @@ -38,8 +37,6 @@ type ImportMissingError struct { newMissingVersion string } -var _ load.ImportPathError = (*ImportMissingError)(nil) - func (e *ImportMissingError) Error() string { if e.Module.Path == "" { if search.IsStandardImportPath(e.Path) { @@ -105,8 +102,6 @@ func (e *AmbiguousImportError) Error() string { return buf.String() } -var _ load.ImportPathError = &AmbiguousImportError{} - type invalidImportError struct { importPath string err error @@ -124,8 +119,6 @@ func (e *invalidImportError) Unwrap() error { return e.err } -var _ load.ImportPathError = &invalidImportError{} - // importFromBuildList finds the module and directory in the build list // containing the package with the given import path. The answer must be unique: // importFromBuildList returns an error if multiple modules attempt to provide |