Compact¶
func Compact[T comparable](slice []T) []T
Compact removes all zero values from the slice. A zero value is determined by the zero value of type T (0 for numbers, "" for strings, nil for pointers, false for bools, etc.).
func Compact[T comparable](slice []T) []T
Compact removes all zero values from the slice. A zero value is determined by the zero value of type T (0 for numbers, "" for strings, nil for pointers, false for bools, etc.).