Skip to content

Commit

Permalink
fixup! Add support for GOPROXY env var
Browse files Browse the repository at this point in the history
  • Loading branch information
icholy committed Jul 8, 2024
1 parent 570a488 commit af1fcfa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions internal/modproxy/modproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ import (
// GOPROXY is the default module proxy
var GOPROXY = "https://proxy.golang.org"

func init() {
if s := os.Getenv("GOPROXY"); s != "" {
GOPROXY = s
}
}

// Module contains the module path and versions
type Module struct {
Path string
Expand Down
6 changes: 0 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ The commands are:
help show this help text
`

func init() {
if goproxy := os.Getenv("GOPROXY"); goproxy != "" {
modproxy.GOPROXY = goproxy
}
}

func main() {
flag.Usage = func() {
fmt.Println(help)
Expand Down

0 comments on commit af1fcfa

Please sign in to comment.