• Agniva De Sarker's avatar
    go/ast: hide unexported fields in composite literals · c2366b27
    Agniva De Sarker authored
    In ast/ast.go, added an Incomplete field inside CompositeLit
    to denote that fields are missing.
    
    In ast/filter.go, added a new function to go through the expression list
    checking for KeyValue expressions inside composite literals.
    Filter out entries with an unexported key.
    
    In printer/nodes.go, checking if the Incomplete field is set,
    and accordingly print the filtered message with proper indentation.
    
    Copying over similar functionality in doc/exports.go so as to
    maintain parity with ast/filter.go and such that godoc
    can show the output correctly.
    
    Fixes #22803
    
    Change-Id: I57a3b999521933e32411a18e02d0b94d2ea2e6f6
    Reviewed-on: https://go-review.googlesource.com/106395
    Run-TryBot: Robert Griesemer <gri@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    c2366b27
Name
Last commit
Last update
..
ast.go Loading commit data...
ast_test.go Loading commit data...
commentmap.go Loading commit data...
commentmap_test.go Loading commit data...
example_test.go Loading commit data...
filter.go Loading commit data...
filter_test.go Loading commit data...
import.go Loading commit data...
print.go Loading commit data...
print_test.go Loading commit data...
resolve.go Loading commit data...
scope.go Loading commit data...
walk.go Loading commit data...