A Comprehensive Guide to Generics in Go | by Steven Ellis | Jan, 2023 | ITNEXT
- Since version 1.18, the Go language has been extended to allow adding explicitly-defined structural constraints — called type parameters — to function declarations & type declarations.
func F[T any](p T) { … }
type M[T any] []