You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update information about GOPROXY, GOSUMDB, GOTOOLCHAIN (#491)
Revised information about goproxy and gotoolchain environment variables.
Added information on gosumdb. All 3 variables are changed from default
values in Fedora go.
Copy file name to clipboardExpand all lines: tech/languages/go/go-installation.md
+27-3Lines changed: 27 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -46,19 +46,43 @@ Writing Go programs is covered in [Go programs](/tech/languages/go/go-programs.h
46
46
47
47
## Fedora Specific Notes
48
48
49
-
The default installation of Go on Fedora contains two changes that Go developers should be aware of.
49
+
The default installation of Go on Fedora contains changes to the default values of `GOPROXY`, `GOSUMDB`, and `GOTOOLCHAIN` environment variables that Go developers should be aware of. The `go` command and related tools make extensive use of environment variables for configuration. Default values are set globally in `/usr/lib/golang/go.env`, and can be overridden on per user or per project basis.
50
+
51
+
For extensive help and information see:
52
+
53
+
```console
54
+
$ go help environment
55
+
```
50
56
51
57
### GOPROXY
52
58
53
-
The value of `GOPROXY` in `$GOROOT/go.env` is set to `direct`. A value of `direct` disables access to the module mirror. See [https://proxy.golang.org](https://proxy.golang.org) for more information on `GOPROXY` and the module mirror. A project specifc `go.env` can override this setting.
59
+
The value of `GOPROXY` in `$GOROOT/go.env` is set to `direct`. A value of `direct` disables access to the module mirror. See [https://proxy.golang.org](https://proxy.golang.org) for more information on `GOPROXY` and the module mirror. A project specific `go.env` can override this setting. A user specific override can be set with:
60
+
61
+
```console
62
+
$ go env -w GOPROXY=https://proxy.golang.org,direct
63
+
```
64
+
65
+
### GOSUMDB
66
+
67
+
The value of `GOSUMDB` in `$GOROOT/go.env` is set to `off` replacing the default value of `sum.golang.org`. The GOSUMDB environment variable identifies the name of the checksum database used to help validate downloaded modules. A project specific `go.env` can override this setting. A user specific override can be set with:
68
+
69
+
```console
70
+
$ go env -w GOSUMDB=sum.golang.org
71
+
```
54
72
55
73
### GOTOOLCHAIN
56
74
57
-
Go 1.21 introduces `GOTOOLCHAIN` which facilitates project specific choices for the Go language toolchain of compiler, standard library, assembler, and other tools. The value of `GOTOOLCHAIN` is set to `local` instead of the default `auto`. See the [Go Toolchain](https://go.dev/doc/toolchain) documentation for more information on toolchains in Go and the implications of using `local` as the default. A project specific `go.env` file can override this setting.
75
+
Go 1.21 introduces `GOTOOLCHAIN` which facilitates project specific choices for the Go language toolchain of compiler, standard library, assembler, and other tools. The value of `GOTOOLCHAIN` is set to `local` instead of the default `auto`. When GOTOOLCHAIN is set to local, the go command always runs the bundled Go toolchain. See the [Go Toolchain](https://go.dev/doc/toolchain) documentation for more information on toolchains in Go. A project specific `go.env` file can override this setting. A user specific override can be set with:
0 commit comments