10
0
Fork 0
mirror of https://github.com/actions/setup-go.git synced 2026-04-07 15:26:54 +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

@ -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