Skip to content

Commit

Permalink
refactor: improve handling of environment variables related to Go mod…
Browse files Browse the repository at this point in the history
…ules
  • Loading branch information
aofei committed Nov 2, 2023
1 parent c899635 commit 28f90c8
Show file tree
Hide file tree
Showing 6 changed files with 550 additions and 397 deletions.
2 changes: 0 additions & 2 deletions fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ func (f *fetch) do(ctx context.Context) (*fetchResult, error) {
r, err = f.doDirect(ctx)
return err
}, func() error {
// go/src/cmd/go/internal/modfetch.errProxyOff
return notFoundErrorf("module lookup disabled by GOPROXY=off")
}); err != nil {
return nil, err
Expand Down Expand Up @@ -167,7 +166,6 @@ func (f *fetch) doProxy(ctx context.Context, proxy string) (*fetchResult, error)
lines := strings.Split(string(b), "\n")
r.Versions = make([]string, 0, len(lines))
for _, line := range lines {
// go/src/cmd/go/internal/modfetch.proxyRepo.Versions
lineParts := strings.Fields(line)
if len(lineParts) > 0 && semver.IsValid(lineParts[0]) && !module.IsPseudoVersion(lineParts[0]) {
r.Versions = append(r.Versions, lineParts[0])
Expand Down

0 comments on commit 28f90c8

Please sign in to comment.