samber / lo

💥 A Lodash-style Go library based on Go 1.18+ Generics (map, filter, contains, find...)
https://pkg.go.dev/github.com/samber/lo
MIT License
18.02k stars 830 forks source link

docs: clarify `Empty` returns zero value #543

Open SnowOnion opened 1 month ago

SnowOnion commented 1 month ago

https://go.dev/ref/spec#The_zero_value does not define “empty value”. It informally mentions “empty value”, meaning (non-nil && 0-length) slice or map.

Note that the zero value for a slice or map type is not the same as an initialized but empty value of the same type.