10
0
Fork 0
mirror of https://github.com/actions/setup-go.git synced 2026-04-05 14:26:56 +00:00

docs: move auto-detect go.mod docs to advanced-usage.md

Follows the pattern from #724 where detailed usage docs live in
docs/advanced-usage.md rather than README.md.
This commit is contained in:
raeperd 2026-03-26 02:09:59 +09:00
parent e9ad3144a4
commit 16c5d19d3e
2 changed files with 12 additions and 12 deletions

View file

@ -102,18 +102,6 @@ For details on Semantic Versioning, see [the semver package documentation](https
>
> The recommendation is based on the YAML parser's behavior, which interprets non-wrapped values as numbers and, in the case of version `1.20`, trims it down to `1.2`, which may not be very obvious.
### Automatic go.mod detection
**New in v6**: If neither `go-version` nor `go-version-file` is specified, the action will automatically look for a `go.mod` file in the repository root and use the Go version specified in it. This simplifies workflows for projects that already have a `go.mod` file.
```yaml
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
# Automatically uses go.mod from repository root
- run: go version
```
For more usage examples, please refer to the section: [Using go-version input](docs/advanced-usage.md#using-the-go-version-input) of the [Advanced usage](docs/advanced-usage.md) guide.
## Recommended permissions

View file

@ -168,6 +168,18 @@ jobs:
If both the `go-version` and the `go-version-file` inputs are provided then the `go-version` input is used. The `.tool-versions` file supports version specifications in accordance with asdf standards, adhering to Semantic Versioning ([semver](https://semver.org)).
### Automatic go.mod detection
If neither `go-version` nor `go-version-file` is specified, the action will automatically look for a `go.mod` file in the repository root and use the Go version specified in it. This simplifies workflows for projects that already have a `go.mod` file.
```yaml
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
# Automatically uses go.mod from repository root
- run: go version
```
```yaml
steps:
- uses: actions/checkout@v6