The generic zero function now is a bit more comprehensible
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package util
|
||||
|
||||
func Zero[T any]() T {
|
||||
return *new(T)
|
||||
var zero T
|
||||
return zero
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user