Go 1.22
go.dev
Go 1.22
1–10 of 164 posts
Re: Go 1.22
#2Re: Go 1.22
#3In the open a lot of projects seem to avoid newish features. I like to use `any` (from 1.18 ~ 2 years ago) where before we had to use `interface{}`, even if I'm not using generics (although I've been told the latter is more "idiomatic" :-/).
Re: Go 1.22
#4The future is now, old man!
Re: Go 1.22
#5For those using Go for production, do you get to switch to the latest versions quickly, or do you get stuck in older releases? In the open a lot of projects seem to avoid newish features. I like to use `any` (from 1.18 ~ 2 years ago) where before we had to use `interface{}`, even if I'm not using generics (although I've been told the latter is more "idiomatic" :-/).
If you're worried about supporting older Go compilers, you could always have build conditions for older versions that define missing things like:
// +build !go1.7
type any = interface{}
Re: Go 1.22
#6For those using Go for production, do you get to switch to the latest versions quickly, or do you get stuck in older releases? In the open a lot of projects seem to avoid newish features. I like to use `any` (from 1.18 ~ 2 years ago) where before we had to use `interface{}`, even if I'm not using generics (although I've been told the latter is more "idiomatic" :-/).
But we also deliver end-user apps with Go, and those have to stick to 1.20 for compatibility with older client OSes. 1.21 made significant cuts and so we will likely be on 1.20 for some years to come.
Re: Go 1.22
#7Re: Go 1.22
#8If you find the official release notes a bit dry, I've made an interactive version: https://antonz.org/go-1-22
Re: Go 1.22
#9> "For" loops may now range over integers The future is now, old man!
Re: Go 1.22
#10This was previously discussed here:
https://news.ycombinator.com/item?id=33160236 - Go: Redefining For Loop Variable Semantics (2022)