diff options
| author | Michael Matloob <matloob@golang.org> | 2025-12-20 11:01:52 -0500 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-12-22 13:24:39 -0800 |
| commit | 97294c2e6e681f4c539ab151abc6ce4ed0d0d28b (patch) | |
| tree | 42fece5a531daf3a8ff5e66193d96d701b2268b7 | |
| parent | 8e69b6f83236bffbbd5ac72691ebb85abadf2fea (diff) | |
| download | go-x-website-97294c2e6e681f4c539ab151abc6ce4ed0d0d28b.tar.xz | |
_content/doc/go1.26: add note for lower go mod init go directive version
Change-Id: I4518c037238cd6316320e78381da76016a6a6964
Reviewed-on: https://go-review.googlesource.com/c/website/+/731720
Reviewed-by: Michael Matloob <matloob@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Michael Matloob <matloob@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
| -rw-r--r-- | _content/doc/go1.26.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/_content/doc/go1.26.md b/_content/doc/go1.26.md index 39a220c9..7361ef70 100644 --- a/_content/doc/go1.26.md +++ b/_content/doc/go1.26.md @@ -49,6 +49,17 @@ func yearsSince(t time.Time) int { ### Go command {#go-command} +<!-- go.dev/issue/74748 --> +`go mod init` now defaults to a lower `go` version in new `go.mod` files. `go mod init` +using a toolchain of version `1.N.X` will create a `go.mod` file +specifying the Go version `go 1.(N-1).0`. Pre-release versions of `1.N` will +create `go.mod` files specifying `go 1.(N-2).0`. In practice, this means Go 1.26 +release candidates will create `go.mod` files with `go 1.24.0`, and Go 1.26 +and its minor releases will create `go.mod` files with `go 1.25.0`. This is intended +to encourage the creation of modules that are compatible with currently supported +versions of Go. For additional control over the `go` version in new modules, +`go mod init` can be followed up with `go get go@version`. + <!-- go.dev/issue/74667 --> `cmd/doc`, and `go tool doc` have been deleted. `go doc` can be used as a replacement for `go tool doc`: it takes the same flags and arguments and |
