|
|
Log in / Subscribe / Register

What's coming in Go 1.18

What's coming in Go 1.18

Posted Feb 8, 2022 23:04 UTC (Tue) by Cyberax (✭ supporter ✭, #52523)
Parent article: What's coming in Go 1.18

One other significant addition: "~" operator for constraints. You can now write: "func min[T ~float32 | ~float64 | ~int](x T, y T) T" meaning that T is a type that behaves like float32, float64 or int.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds