diff options
| author | Jonathan Amsterdam <jba@google.com> | 2021-08-20 16:22:56 -0400 |
|---|---|---|
| committer | Jonathan Amsterdam <jba@google.com> | 2021-08-23 19:25:42 +0000 |
| commit | ab08cc0ceef6baec2b8a49be2f0cba4284f44e4d (patch) | |
| tree | 505ef0daf66bfc9030fbda6167e4e0c593a84874 /internal/fetch | |
| parent | 25e51bd952c2f3cdc94bc3ae8d0f98721fe486b5 (diff) | |
| download | go-x-pkgsite-ab08cc0ceef6baec2b8a49be2f0cba4284f44e4d.tar.xz | |
internal/fetch: remove empty-module-path code
An empty module path in fetch won't happen since we made the
DirectoryModuleGetter figure out its module path.
For golang/go#47834
Change-Id: I953ad425c7e13ec4e771f4160870e5ef8f7349ff
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/343960
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Diffstat (limited to 'internal/fetch')
| -rw-r--r-- | internal/fetch/fetch.go | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/internal/fetch/fetch.go b/internal/fetch/fetch.go index 17011695..563ba5b6 100644 --- a/internal/fetch/fetch.go +++ b/internal/fetch/fetch.go @@ -145,19 +145,6 @@ func FetchModule(ctx context.Context, modulePath, requestedVersion string, mg Mo } func fetchModule(ctx context.Context, fr *FetchResult, mg ModuleGetter, sourceClient *source.Client) (*FetchInfo, error) { - // If the module path is empty, get it from the go.mod file. This should only happen when fetching - // a local module. - if fr.ModulePath == "" { - goModBytes, err := mg.Mod(ctx, fr.ModulePath, fr.RequestedVersion) - if err != nil { - return nil, err - } - fr.ModulePath = modfile.ModulePath(goModBytes) - if fr.ModulePath == "" { - return nil, fmt.Errorf("go.mod has no module path: %w", derrors.BadModule) - } - } - info, err := GetInfo(ctx, fr.ModulePath, fr.RequestedVersion, mg) if err != nil { return nil, err |
