在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:actions/setup-go开源软件地址:https://github.com/actions/setup-go开源编程语言:TypeScript 99.2%开源软件介绍:setup-goThis action sets up a go environment for use in actions by:
V3The V3 edition of the action offers:
The action will first check the local cache for a version match. If a version is not found locally, it will pull it from the Note: The Matching by semver spec: steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '^1.13.1' # The Go version to download (if necessary) and use.
- run: go version steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '>=1.17.0'
- run: go version Matching an unstable pre-release: steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.18.0-rc.1' # The Go version to download (if necessary) and use.
- run: go version steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.16.0-beta.1' # The Go version to download (if necessary) and use.
- run: go version UsageSee action.yml Basicsteps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.16.1' # The Go version to download (if necessary) and use.
- run: go run hello.go Check latest versionThe If
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.14'
check-latest: true
- run: go run hello.go Caching dependency files and build outputs:The action has a built-in functionality for caching and restoring go modules and build outputs. It uses actions/cache under the hood but requires less configuration settings. The The action defaults to search for the dependency file - go.sum in the repository root, and uses its hash as a part of the cache key. Use Caching without specifying dependency file path steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.17'
check-latest: true
cache: true
- run: go run hello.go Caching in monorepos steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.17'
check-latest: true
cache: true
cache-dependency-path: subdir/go.sum
- run: go run hello.go Getting go version from the go.mod fileThe If both the
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'path/to/go.mod'
- run: go version Matrix testingjobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.14', '1.13' ]
name: Go ${{ matrix.go }} sample
steps:
- uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- run: go run hello.go Supported version syntaxThe
For more information about semantic versioning, please refer to semver documentation. LicenseThe scripts and documentation in this project are released under the MIT License ContributionsContributions are welcome! See Contributor's Guide Code of Conduct |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论