Skip to content

Conversation

SnowOnion
Copy link
Contributor

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.

xuanhong added 2 commits October 18, 2024 14:35
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.
@samber samber merged commit 9c6999e into samber:master Jan 24, 2025
samber pushed a commit that referenced this pull request Jan 24, 2025
* docs: clarify `Empty` returns zero value

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.

* docs: other "empty value" -> "zero value"

---------

Co-authored-by: xuanhong <litianchi@papegames.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants