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

update minimum go version to go1.17 #1871

Closed
wants to merge 1 commit into from

Conversation

thaJeztah
Copy link
Contributor

Versions of go below go1.18 have reached EOL, but some projects may be slightly behind and still on go1.17.

This patch updates the minimum Go version to go1.17, as older versions are broken in CI:

Error: ../../../go/pkg/mod/github.com/kyoh86/[email protected]/config/load.go:64:9: undefined: os.ReadFile
note: module requires Go 1.17
Error: Process completed with exit code 2.

Versions of go below go1.18 have reached EOL, but some projects
may be slightly behind and still on go1.17.

This patch updates the minimum Go version to go1.17, as older versions
are broken in CI:

    Error: ../../../go/pkg/mod/github.com/kyoh86/[email protected]/config/load.go:64:9: undefined: os.ReadFile
    note: module requires Go 1.17
    Error: Process completed with exit code 2.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@github-actions github-actions bot added the area/github For changes to Github specific things not shipped in the library label Dec 5, 2022
@marckhouzam
Copy link
Collaborator

Thanks @thaJeztah. We're in discussion right now about dropping support for go 1.15 or not. CI is failing because of a tool we use for CI only so technically Cobra can continue to support go 1.15.

Although these versions of go are EOL, it may not be cobra's place to force projects to upgrade unless we have a legitimate need to stop using these old versions.

We'll get this sorted out soon.

Sorry about the hassle.

@umarcor
Copy link
Contributor

umarcor commented Dec 5, 2022

@marckhouzam this seems to be motivated by a direct dependency of cobra (github.com/inconshreveable/mousetrap), unrelated to richgo. So this is not about deprecating 1.15 but <1.17.

@marckhouzam
Copy link
Collaborator

I prefer not to force projects to upgrade their go version unless Cobra really needs it. Even if go 1.15 is EOL for a while, Cobra still works with it, the CI failure was due to a CI dependency not a Cobra dependency.

I'll close this, but if you feel it still should be considered please reopen.

@marckhouzam marckhouzam closed this Jan 3, 2023
@umarcor
Copy link
Contributor

umarcor commented Jan 9, 2023

@marckhouzam as far as I understand, since #1872 was merged, cobra does require go 1.17<, at least on Windows.

However, on Windows we do test a single version, which is currenly 1.19 (see https://packages.msys2.org/base/mingw-w64-go). And the code on "others" is almost none: https://github.com/inconshreveable/mousetrap/blob/master/trap_others.go.

Does golang ignore the go version specified in the dependencies (https://github.com/inconshreveable/mousetrap/blob/master/go.mod#L3)? Otherwise, building the current cobra main using go 1.16 should be failing.

On the other hand, maybe mousetrap does not use any feature that forces to use go 1.16< and it is specified go 1.18 just because the file was added in august: https://github.com/inconshreveable/mousetrap/commits/master/go.mod. If that's the case, cobra might keep ignoring it.

@thaJeztah
Copy link
Contributor Author

Go currently uses the version specified in the go.mod as a "recommended minimum version" (it doesn't block other versions of go to be used, but considers the version to be the "known to work with, and older versions may not work".

That said, Go (and other tools) may look at the go version in go.mod. For example, when using go mod tidy or go mod vendor, it may use that version to determine whether to use "module pruning" in the resulting go.mod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/github For changes to Github specific things not shipped in the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI fails for Go 1.15
3 participants