Go 1.21rc1 is released! It’s not a final release yet, but we already can see what new features will be there, and that’s huge:
- Built-in function
min
,max
, andclear
. You know, like in all other normal programming languages. - Experimental fix for the loop variable capture, one of the most common Go mistakes.
- Profile-guided optimization is now stable. The Go compiler itself now uses it to make its code 10% faster.
- Structured logging, with both human-readable and JSON output. For me personally it 100% replaces any third-party logging libraries.
- Generic functions for slices and maps.
- WASI support. WASI is the standard of defining system calls in WebAssembly.
The release notes draft: https://tip.golang.org/doc/go1.21
That’s a short list but every item on it is amazing. I hope they’ll pick enums (or union types, about the same thing, as Rust shows) next, the most requested Go feature at the moment.