Skip to content
New issue

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

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

Already on GitHub? # to your account

[BUG] - Minimun Go version for library consumers #362

Open
ldez opened this issue Mar 5, 2025 · 0 comments
Open

[BUG] - Minimun Go version for library consumers #362

ldez opened this issue Mar 5, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ldez
Copy link

ldez commented Mar 5, 2025

Describe the bug

Since go1.21, the Go version used inside the go.mod is the minimum Go version and it's a hard requirement.

So, as govultr is a library, each time you update the minimum Go version, you are forcing all the library consumers to update their minimal Go version.

A library should avoid doing that.

The minimum Go version defines the version of the language used to write the code.

The Go version inside toolchain defined the Go version used to compile a binary (govultr doesn't have main package so it's useless in this context) or run the tests, and doesn't affect lib consumers.

To Reproduce

$ mkdir vultr-go && cd $_
$ go mod init github.com/example/foo
$ go mod edit -go 1.22 
$ cat go.mod     
module github.com/example/foo

go 1.22
$ go get -u github.com/vultr/govultr/v3@latest
go: upgraded go 1.22 => 1.24
go: added toolchain go1.24.0
go: added github.com/google/go-querystring v1.1.0
go: added github.com/hashicorp/go-cleanhttp v0.5.2
go: added github.com/hashicorp/go-retryablehttp v0.7.7
go: added github.com/vultr/govultr/v3 v3.15.0
$ cat go.mod
module github.com/example/foo

go 1.24

toolchain go1.24.0

require (
        github.com/google/go-querystring v1.1.0 // indirect
        github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
        github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
        github.com/vultr/govultr/v3 v3.15.0 // indirect
)

Related to #360 (go1.24) created by @optik-aper during go1.23/go1.24 maintenance cycle
Related to #333 (go1.23) created by @optik-aper during go1.22/go1.23 maintenance cycle

Expected behavior

I expected that govultr doesn't force the update to the latest Go version.

The Go team maintains the 2 latest minor versions: currently go1.23 and go1.24.
I can understand an update to min go1.23, even though there is no code requirement, but go1.24 seems inappropriate for a library.

@ldez ldez added the bug Something isn't working label Mar 5, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant