Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
builtin: make len's godoc less ambiguous
The len godoc uses a blockquote to list the rules for its semantics. The item that describes channels is a bit long, so it's split in two lines. However, the first line ends with a semicolon, and the second line can be read as a sentence of its own, so it's easy to misinterpret that the two lines are separate. Making that easy mistake would lead to an incorrect understanding of len: if v is nil, len(v) is zero. This could lead us to think that len(nil) is valid and should return zero. When in fact, that statement only applies to nil channels. To make this less ambiguous, add a bit of indentation to the follow-up line, to align with the channel body. If lists are added to godoc in the future via golang#7873, perhaps this text can be simplified. Fixes golang#30349. Change-Id: I84226edc812d429493137bcc65c332e92d4e6c87 Reviewed-on: https://go-review.googlesource.com/c/go/+/167403 Run-TryBot: Daniel Martí <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
- Loading branch information