Skip to content

Commit e4fa1e4

Browse files
committed
go/doc: document rationale for recent change
LGTM=adg R=adg CC=golang-codereviews https://golang.org/cl/143290043
1 parent e9ec8e7 commit e4fa1e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/go/doc/exports.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import (
1212
)
1313

1414
// filterIdentList removes unexported names from list in place
15-
// and returns the resulting list.
15+
// and returns the resulting list. If blankOk is set, blank
16+
// identifiers are considered exported names.
1617
//
1718
func filterIdentList(list []*ast.Ident, blankOk bool) []*ast.Ident {
1819
j := 0
@@ -145,6 +146,8 @@ func (r *reader) filterSpec(spec ast.Spec, tok token.Token) bool {
145146
// always keep imports so we can collect them
146147
return true
147148
case *ast.ValueSpec:
149+
// special case: consider blank constants as exported
150+
// (work-around for issue 5397)
148151
s.Names = filterIdentList(s.Names, tok == token.CONST)
149152
if len(s.Names) > 0 {
150153
r.filterType(nil, s.Type)

0 commit comments

Comments
 (0)