Skip to content

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

Closed
@ldez

Description

@ldez

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions