- Use go1.17 for github actions.
- Use go mod edit instead of go get for testing other packages. There's two
benefits:
- This removes the round trip to pkg.go.dev and use the already present local
checkout.
- The go get periph.io/x/conn/v3@${GITHUB_SHA} command worked if a maintainer
push a branch, but fails for a PR. This is because the go get command does a
clone with all the branches, so it finds the commit even if it's not in main.
For a PR, one has to pull a specific refs/pull/ID/head ref that is not a
branch, thus go get cannot find it because git clone doesn't know about it.
The only way to work around is to git clone manually.
- Remove 'go version' and 'go env' since they are already run as part of
setup-go@v2.
- Fix a new check in go vet in example code.
This does result in a few awkward cases but in general it's worth
enforcing and most importantly will make my life as a code reviewer
easier.
It's mostly deletion of dead code.
This is done by changing the cache key.
go get tools currently fail with:
# cd /home/runner/go/src/golang.org/x/tools; git pull --ff-only
From https://go.googlesource.com/tools
+ 63754364...8b4aab62 master -> origin/master (forced update)
ab9934f0..f2d1c246 gopls-release-branch.0.6 -> origin/gopls-release-branch.0.6
* [new branch] internal-branch.issue43628 -> origin/internal-branch.issue43628
* [new tag] gopls/v0.6.2 -> gopls/v0.6.2
* [new tag] gopls/v0.6.3-pre.1 -> gopls/v0.6.3-pre.1
fatal: Not possible to fast-forward, aborting.
package golang.org/x/tools/go/analysis: exit status 128
See https://github.com/periph/devices/pull/2/checks?check_run_id=1693498363