The easiest way to get a zero value for a generic is to simply declare a variable with var and return it, since by definition, var always initializes its variable to the zero value if no other value is assigned.
Generics in Go. Generics is the concept that it is… | by Ahmad Berahman | Geek Culture | Medium
https://medium.com/geekculture/generics-in-go-5a36b1f978bc
#golang #generics #zerovalues #tips