Skip to content
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

chore: bump minimum go version 1.18 #13

Merged
merged 1 commit into from
Oct 21, 2022
Merged

chore: bump minimum go version 1.18 #13

merged 1 commit into from
Oct 21, 2022

Conversation

pcj
Copy link

@pcj pcj commented Oct 21, 2022

@kyoh86 Your comment on the last PR made me think it would be a good idea to make the minimum go version to 1.18.

@kyoh86
Copy link
Owner

kyoh86 commented Oct 21, 2022

looppointer does not require go 1.18. But x/tools 0.20 requires it. It's enough.

@kyoh86 kyoh86 closed this Oct 21, 2022
@pcj
Copy link
Author

pcj commented Oct 21, 2022

Note the go directive in the go.mod file does not say anything about a runtime requirement, it's just for compilation.

For example, you can't compile the project with go 1.16.2 anymore:

$ go install golang.org/dl/go1.16.2@latest
$ ~/go/bin/go1.16.2 download
$ ~/go/bin/go1.16.2 install ./cmd/looppointer
go: golang.org/x/tools@v0.2.0 requires
	github.com/yuin/goldmark@v1.4.13: missing go.sum entry; to add it:
	go mod download github.com/yuin/goldmark
$ echo $?
1

Whereas:

$ go install golang.org/dl/go1.18.2@latest
$ ~/go/bin/go1.18.2 download
$ ~/go/bin/go1.18.2 install ./cmd/looppointer
$ echo $?
0

Also, your CI is set to 1.18.

@pcj pcj changed the title bump minimum go version 1.18 chore: bump minimum go version 1.18 Oct 21, 2022
@kyoh86
Copy link
Owner

kyoh86 commented Oct 21, 2022

📝 The error does not related on this issue.

go: golang.org/x/tools@v0.2.0 requires
github.com/yuin/goldmark@v1.4.13: missing go.sum entry; to add it:
go mod download github.com/yuin/goldmark

go < 1.18, it raises runtime error.

$ ~/go/bin/go1.16.2 install ./cmd/looppointer
$ looppointer .  
looppointer: internal error: package "fmt" without types was imported from "github.com/kyoh86/looppointer"

@kyoh86 kyoh86 reopened this Oct 21, 2022
@kyoh86 kyoh86 merged commit 3752f5a into kyoh86:main Oct 21, 2022
@pcj pcj deleted the pcj/go-18 branch October 21, 2022 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants