this post was submitted on 21 Jun 2023
5 points (100.0% liked)

Go programming language discussion

1382 readers
1 users here now

founded 5 years ago
MODERATORS
 

Go 1.21 release candidate is available.

It has some interesting changes in my opinion:

  • clear() for clearing maps
  • new slices package for common operations on slices
  • new maps package for cloning and comparing maps

And some somewhat interesting ones:

  • min/max function directly in the language without a package (could have easily been in math package, but then again, you can min/max strings with this?)
  • structured logging package

Some other optimizations and improvements.

What do you think?

top 3 comments
sorted by: hot top controversial new old
[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

could have easily been in math package

Not easily while avoiding the allocation hit of variadic arguments. But funny that, after all these years waiting on parametric polymorphism to be able to add a generalized min/max, it ends up as a built-in anyway.

[–] [email protected] 1 points 1 year ago

I'm excited for min/max and for log/slog!

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

Wow super excited about slices package! Very nice quality of life addition.

load more comments
view more: next ›