Skip to content

Commit

Permalink
_content: update go.mod examples to use full go versions
Browse files Browse the repository at this point in the history
There's confusion on whether 1.X or 1.X.Y is canonical,
the documentation should reflect the defaults of cmd/go.

Updates golang/go#62278

Change-Id: I00489774e686d774cd970394237dff0462272cef
Reviewed-on: https://go-review.googlesource.com/c/website/+/643615
Reviewed-by: Sam Thanawalla <[email protected]>
Reviewed-by: Michael Matloob <[email protected]>
Auto-Submit: Daniel Martí <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: David Chase <[email protected]>
  • Loading branch information
seankhliao authored and gopherbot committed Feb 11, 2025
1 parent 9827523 commit 255602d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions _content/doc/modules/managing-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ directory.
```
module example.com/mymodule

go 1.16
go 1.23.0

require example.com/theirmodule v0.0.0-unpublished

Expand Down Expand Up @@ -404,7 +404,7 @@ module's own repository.
```
module example.com/mymodule

go 1.16
go 1.23.0

require example.com/theirmodule v1.2.3

Expand Down
12 changes: 6 additions & 6 deletions _content/ref/mod.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ directive, made up of a keyword followed by arguments. For example:
```
module example.com/my/thing
go 1.12
go 1.23.0
require example.com/other/thing v1.0.2
require example.com/new/thing/v2 v2.3.4
Expand Down Expand Up @@ -546,7 +546,7 @@ major version. Individual minor and patch versions cannot be deprecated;

A `go` directive indicates that a module was written assuming the semantics of a
given version of Go. The version must be a valid [Go version](/doc/toolchain#version),
such as `1.9`, `1.14`, or `1.21rc1`.
such as `1.14`, `1.21rc1`, or `1.23.0`.

The `go` directive sets the minimum version of Go required to use this module.
Before Go 1.21, the directive was advisory only; now it is a mandatory requirement:
Expand Down Expand Up @@ -615,7 +615,7 @@ GoVersion = string | ident . /* valid release version; see above */
Example:

```
go 1.14
go 1.23.0
```

### `toolchain` directive {#go-mod-file-toolchain}
Expand Down Expand Up @@ -959,7 +959,7 @@ For example, consider this `go.mod` file:
```
module example.com/M
go 1.16
go 1.23.0
require (
example.com/A v1
Expand Down Expand Up @@ -1218,7 +1218,7 @@ A workspace is defined by a UTF-8 encoded text file named `go.work`. The
a keyword followed by arguments. For example:

```
go 1.18
go 1.23.0
use ./my/first/thing
use ./my/second/thing
Expand Down Expand Up @@ -1318,7 +1318,7 @@ GoVersion = string | ident . /* valid release version; see above */
Example:

```
go 1.18
go 1.23.0
```

### `toolchain` directive {#go-work-file-toolchain}
Expand Down

0 comments on commit 255602d

Please sign in to comment.