]> Cypherpunks repositories - gostls13.git/commitdiff
Revert "cmd/doc: better support for no network"
authorMichael Matloob <matloob@golang.org>
Thu, 22 May 2025 16:12:48 +0000 (09:12 -0700)
committerMichael Matloob <matloob@golang.org>
Thu, 22 May 2025 18:05:12 +0000 (11:05 -0700)
This reverts commit 988eb0d11e8d96e8ca150f401ed82326b276f653.

Reason for revert: breaks viewing documentation for unfetched modules

For #73833

Change-Id: I89bc459e820c85e96837d1707058501488a14eef
Reviewed-on: https://go-review.googlesource.com/c/go/+/675575
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
src/cmd/doc/main.go
src/cmd/go/internal/load/pkg.go

index 22db39ecc943bd71af4a38c8b5be4c7a45c76c6a..ccd851200671691a18089bb6b280a491dbc27a59 100644 (file)
@@ -259,18 +259,10 @@ func doPkgsite(urlPath string) error {
        signal.Ignore(signalsToIgnore...)
 
        const version = "v0.0.0-20250520201116-40659211760d"
-       docatversion := "golang.org/x/pkgsite/cmd/internal/doc@" + version
-       // First download the module and then try to run with GOPROXY=off to circumvent
-       // the deprecation check. This will allow the pkgsite command to run if it's
-       // in the module cache but there's no network.
-       if _, err := runCmd(nil, "go", "mod", "download", docatversion); err != nil {
-               return err
-       }
-       cmd := exec.Command("go", "run", docatversion,
+       cmd := exec.Command("go", "run", "golang.org/x/pkgsite/cmd/internal/doc@"+version,
                "-gorepo", buildCtx.GOROOT,
                "-http", addr,
                "-open", path)
-       cmd.Env = append(os.Environ(), "GOPROXY=off")
        cmd.Stdout = os.Stderr
        cmd.Stderr = os.Stderr
 
index 34e8c90b2faa3e955d6dd304dcaa240c59f2cbc6..e913f9885234fda9330bb6b7ead384cd39228b18 100644 (file)
@@ -3410,7 +3410,7 @@ func PackagesAndErrorsOutsideModule(ctx context.Context, opts PackageOpts, args
        }
        rootMod := qrs[0].Mod
        deprecation, err := modload.CheckDeprecation(ctx, rootMod)
-       if err != nil && !errors.Is(err, fs.ErrNotExist) {
+       if err != nil {
                return nil, fmt.Errorf("%s: %w", args[0], err)
        }
        if deprecation != "" {