Skip to content

Commit 1dcba4a

Browse files
committed
Update to Go 1.16
1.16 is now the preferred Go version for all Arduino tooling projects. The update from Go 1.14 to 1.16 broke the task that runs golint. The good news is that the new go install command eliminates the need for the workaround of running the go get golang.org/x/lint/golint command from outside the project path. The bad news is the go list command used to get the path of the golint installation does not work in the "module-aware mode" that is now the default. In the end, I gave up on making the task work as before. I think it's better to require the user to install golint and put the installation in the system PATH, displaying a helpful message when this has not been done.
1 parent 36e7bfc commit 1dcba4a

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

.github/workflows/check-go.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ jobs:
6666
repo-token: ${{ secrets.GITHUB_TOKEN }}
6767
version: 3.x
6868

69+
- name: Install golint
70+
run: go install golang.org/x/lint/golint@latest
71+
6972
- name: Check style
70-
run: task go:lint
73+
run: task --silent go:lint
7174

7275
check-formatting:
7376
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Create Release
22

33
env:
44
# See: https://github.com/actions/setup-go/tree/v2#readme
5-
GO_VERSION: "1.14"
5+
GO_VERSION: "1.16"
66

77
on:
88
push:

.github/workflows/test-go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Test Go
22

33
env:
44
# See: https://github.com/actions/setup-go/tree/v2#readme
5-
GO_VERSION: "1.14"
5+
GO_VERSION: "1.16"
66

77
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
88
on:

.github/workflows/test-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Test Integration
22

33
env:
44
# See: https://github.com/actions/setup-go/tree/v2#readme
5-
GO_VERSION: "1.14"
5+
GO_VERSION: "1.16"
66
# See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python
77
PYTHON_VERSION: "3.9"
88

Taskfile.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@ tasks:
4949
go:lint:
5050
desc: Lint Go code
5151
cmds:
52-
- go get golang.org/x/lint/golint
5352
- |
54-
GOLINT_PATH="$(go list -f '{{"{{"}}.Target{{"}}"}}' golang.org/x/lint/golint || echo "false")"
55-
"$GOLINT_PATH" \
53+
if ! which golint &>/dev/null; then
54+
echo "golint not installed or not in PATH. Please install: https://github.com/golang/lint#installation"
55+
exit 1
56+
fi
57+
- |
58+
golint \
5659
{{default "-min_confidence 0.8 -set_exit_status" .GO_LINT_FLAGS}} \
5760
{{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
5861

go.sum

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
1919
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
2020
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
2121
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
22-
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
2322
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
2423
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
2524
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

0 commit comments

Comments
 (0)