Skip to content

Update to Go 1.16 #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2021
Merged

Update to Go 1.16 #65

merged 1 commit into from
Aug 20, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Aug 16, 2021

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:

$ go mod tidy && task --silent go:lint
no required module provides package golang.org/x/lint/golint: go.mod file not found in current directory or any parent directory; see 'go help modules'
task: Failed to run task "go:lint": exit status 1

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 in order to avoid pollution of go.sum.

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 (and will be the only mode in Go 1.17). 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.

@per1234 per1234 added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels Aug 16, 2021
@per1234 per1234 requested a review from cmaglie August 16, 2021 19:18
go 1.14
go 1.16
Copy link
Contributor Author

@per1234 per1234 Aug 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize this change does not necessarily follow from the others, but it seems that in this case there are only downsides to indicating compatibility with a Go version we don't do any testing for. It's likely that arduino/library-registry is the only user of the module anyway, since this module's API currently only provides for reading the data format of the library registry file. The program in arduino/library-registry has already been updated 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:

```
$ go mod tidy && task --silent go:lint
no required module provides package golang.org/x/lint/golint: go.mod file not found in current directory or any parent directory; see 'go help modules'
task: Failed to run task "go:lint": exit status 1
```

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 in order to avoid pollution of `go.sum`.

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 (and will be the only mode in Go 1.17). 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.
@per1234 per1234 merged commit e598ad7 into arduino:main Aug 20, 2021
@per1234 per1234 deleted the bump-go branch August 20, 2021 13:10
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants