aboutsummaryrefslogtreecommitdiff
path: root/cmd/internal
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2025-03-10 17:06:39 -0400
committerJonathan Amsterdam <jba@google.com>2025-03-11 13:38:48 -0700
commit656a0a051eeb9bd12d44e8000e856b0ee23568b1 (patch)
tree9d35be7b815fd62ac92dd3f35b504b6a735f4aff /cmd/internal
parent38e05702228bdf47f645eb95194ca43c1b10646e (diff)
downloadgo-x-pkgsite-656a0a051eeb9bd12d44e8000e856b0ee23568b1.tar.xz
go.mod, misc: update to go 1.24
Change-Id: Iba3d15376214048113314150944d3b0df187a8cf Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/656475 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'cmd/internal')
-rw-r--r--cmd/internal/pkgsite/server.go14
1 files changed, 1 insertions, 13 deletions
diff --git a/cmd/internal/pkgsite/server.go b/cmd/internal/pkgsite/server.go
index 14356837..f97e3505 100644
--- a/cmd/internal/pkgsite/server.go
+++ b/cmd/internal/pkgsite/server.go
@@ -14,7 +14,6 @@ import (
"os"
"os/exec"
"path/filepath"
- "runtime"
"sort"
"strings"
"time"
@@ -243,7 +242,7 @@ func buildGetters(ctx context.Context, cfg getterConfig) ([]fetch.ModuleGetter,
if cfg.useLocalStdlib {
goRepo := cfg.goRepoPath
if goRepo == "" {
- goRepo = getGOROOT()
+ goRepo = internal.GOROOT()
}
if goRepo != "" { // if goRepo == "" we didn't get a *goRepoPath and couldn't find GOROOT. Fall back to the zip files.
mg, err := fetch.NewGoPackagesStdlibModuleGetter(ctx, goRepo)
@@ -265,17 +264,6 @@ func buildGetters(ctx context.Context, cfg getterConfig) ([]fetch.ModuleGetter,
return getters, nil
}
-func getGOROOT() string {
- if rg := runtime.GOROOT(); rg != "" {
- return rg
- }
- b, err := exec.Command("go", "env", "GOROOT").Output()
- if err != nil {
- return ""
- }
- return strings.TrimSpace(string(b))
-}
-
func newServer(getters []fetch.ModuleGetter, localModules []frontend.LocalModule, prox *proxy.Client, devMode bool, staticFlag string) (*frontend.Server, error) {
lds := fetchdatasource.Options{
Getters: getters,