Live data from Hacker News

Stop picking my Go version for me

blog.howardjohn.info

41–50 of 64 posts

Re: Stop picking my Go version for me

#41
post #35

This just got me. Datadog decided that they only support the current and last major versions of Go. So, 1.26 and 1.25. But in my cause we're still on 1.24.13 which was released by the Go team less than two months ago. Datadog won't be getting a renewal from us.

What hacks are you relying on that makes it impossible to upgrade to 1.25 or even 1.26?

Does it even matter?

Re: Stop picking my Go version for me

#42
My solution for this is just use the current latest, or latest-1. There’s no reason not to. If your code is somehow stuck with an old version of Go, it should be considered a high priority bug, this is not normal.

Re: Stop picking my Go version for me

#43

This just got me. Datadog decided that they only support the current and last major versions of Go. So, 1.26 and 1.25. But in my cause we're still on 1.24.13 which was released by the Go team less than two months ago. Datadog won't be getting a renewal from us.

> But in my cause we're still on 1.24.13 which was released by the Go team less than two months ago.

Yes, and then one week later the entire 1.24 branch entered EOL: https://endoflife.date/go

Re: Stop picking my Go version for me

#44

>My package really does depend on the latest patch release! > Even in the event that your packages code is only correct with a specific patch release, I still think its wrong to put that version in the go directive unless it cannot be compiled with any other version. I'm not a go user, but this strikes me as an over-reaction. If your code is only correct with a specific patch release, then it really is your business…

I can admit that part was maybe a bit extreme :) fortunately in practice this would be a pretty rare situation IME due to how compatible Go is across versions. (Blog author)

Thank you for this article. If I want to be told when to upgrade, I know where to shop, i.e. Bill's Bloatware in Redmond.

Re: Stop picking my Go version for me

#45
post #26
post #18

Same situation in Rust crates, AIUI.

In go, `go mod init` and `go get go@latest` (both recommended commands), both set a 'go ' stanzas. In go, you _must_ set a minimum required version. If you type 'cargo init', you will get 'edition = "2024"', but no 'rust-version'. The situation is different because rust does not require a 'rust-version' in Cargo.toml, and in practice most crates do not have one, while in go it is required you specify a minimum versio…

Oof, got it.

Re: Stop picking my Go version for me

#46
post #31

> The version is the minimum version your project can be compiled with. No, it's the minimum version my project is tested with. > This means when you put a version like 1.25.7, you are deciding for everyone that imports you, transitively or directly, that they MUST be on Go 1.25.7+ to compile their project. That is fine. This isn't Python or Java, you have no reason to ever be more than one version behind the current…

Thanks for the link! I could have sworn this was "fixed" and was surprised testing 1.26.1 showed the same (IMO bad) behavior! Didn't realize there was a revert. https://github.com/golang/go/issues/77923 looks like a hopeful path forward.

Re: Stop picking my Go version for me

#47
I've seen this misconception so many times in open source projects - commits just bumping the version in go.mod to 'get the latest performance and security improvements.' Like no, that's not how it works, you just made your code compile with fewer compiler versions for no reason.

I think the directive could have been named better though, maybe something like min_version.

Re: Stop picking my Go version for me

#48
The transitive dependency case is what makes this painful in practice. You’re not even choosing that library it’s three levels deep in your dependency tree, and suddenly CI fails because some maintainer ran `go get go@latest` on a Saturday.

Re: Stop picking my Go version for me

#49

>My package really does depend on the latest patch release! > Even in the event that your packages code is only correct with a specific patch release, I still think its wrong to put that version in the go directive unless it cannot be compiled with any other version. I'm not a go user, but this strikes me as an over-reaction. If your code is only correct with a specific patch release, then it really is your business…

I can admit that part was maybe a bit extreme :) fortunately in practice this would be a pretty rare situation IME due to how compatible Go is across versions. (Blog author)

I’m afraid setting a version lower than the one you’re using means you have to setup a CI of some kind to verify compilation does indeed work for previous versions of go.

Maybe that’s why some author do not bother and put the version they are using (though I do agree it is a bad practice indeed).

Re: Stop picking my Go version for me

#50
The issue I'm having with this is, that I'm using the newest version to test my library

Does go support automatic testing of all version from X..Y?

Otherwise I don't see it being usable to define another version than the one I'm testing with in my go.mod

Post reply on HN