golang/go
在 GitHub 查看x/pkgsite: confusing display of constants block when there are unexported constants
Open
#39,097 创建于 2020年5月15日
DocumentationNeedsInvestigationToolshelp wantedpkgsite
仓库指标
- Star
- (133,883 star)
- PR 合并指标
- (30 天内没有已合并 PR)
描述
If you look at documentation on this page: https://golang.org/pkg/text/template/parse/#NodeType
The NodeDot is 6 and NodeField is 8, but there is nothing between these two constants. however the source has two unexported consts between NodeDot and NodeField, which makes NodeField 8.
When you debug the code you can easly misunderstand the node types but simply counting them from the top.
The documentation should indicate actual values of constants