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:

  1. Built-in function min, max, and clear. You know, like in all other normal programming languages.
  2. Experimental fix for the loop variable capture, one of the most common Go mistakes.
  3. Profile-guided optimization is now stable. The Go compiler itself now uses it to make its code 10% faster.
  4. Structured logging, with both human-readable and JSON output. For me personally it 100% replaces any third-party logging libraries.
  5. Generic functions for slices and maps.
  6. 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.