Skip to content

Commit

Permalink
fix(main/golang): GOPROXY and GOSUMDB are empty by default
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin WIlliams <[email protected]>
  • Loading branch information
2096779623 committed Aug 12, 2023
1 parent e1c11c4 commit ff58e3c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/golang/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ TERMUX_PKG_MAINTAINER="@termux"
_MAJOR_VERSION=1.21
# Use the ~ deb versioning construct in the future:
TERMUX_PKG_VERSION=3:${_MAJOR_VERSION}.0
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://storage.googleapis.com/golang/go${TERMUX_PKG_VERSION#*:}.src.tar.gz
TERMUX_PKG_SHA256=818d46ede85682dd551ad378ef37a4d247006f12ec59b5b755601d2ce114369a
TERMUX_PKG_DEPENDS="clang"
Expand Down
16 changes: 16 additions & 0 deletions packages/golang/fix-GOPROXY-and-GOSUMDB-default-is-empty.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
https://github.com/golang/go/commit/7aa85e01376d840acc8bb931156d607a00b64a60

diff -uNr go/src/cmd/go/internal/cfg/cfg.go go.mod/src/cmd/go/internal/cfg/cfg.go
--- go/src/cmd/go/internal/cfg/cfg.go 2023-08-05 04:14:06.000000000 +0800
+++ go.mod/src/cmd/go/internal/cfg/cfg.go 2023-08-12 16:33:35.167682584 +0800
@@ -417,8 +417,8 @@
GOPPC64 = envOr("GOPPC64", fmt.Sprintf("%s%d", "power", buildcfg.GOPPC64))
GOWASM = envOr("GOWASM", fmt.Sprint(buildcfg.GOWASM))

- GOPROXY = envOr("GOPROXY", "")
- GOSUMDB = envOr("GOSUMDB", "")
+ GOPROXY = envOr("GOPROXY", "https://proxy.golang.org,direct")
+ GOSUMDB = envOr("GOSUMDB", "sum.golang.org")
GOPRIVATE = Getenv("GOPRIVATE")
GONOPROXY = envOr("GONOPROXY", GOPRIVATE)
GONOSUMDB = envOr("GONOSUMDB", GOPRIVATE)

0 comments on commit ff58e3c

Please sign in to comment.