mirror of
https://github.com/golang/go.git
synced 2025-11-01 17:20:56 +00:00
cmd/api: include constant values
Update #5935 R=golang-dev, rsc, iant, dave CC=golang-dev https://golang.org/cl/13261050
This commit is contained in:
parent
da50221e8e
commit
8a70b50b1f
2 changed files with 9 additions and 4 deletions
|
|
@ -690,16 +690,13 @@ func (w *Walker) emitObj(obj types.Object) {
|
|||
switch obj := obj.(type) {
|
||||
case *types.Const:
|
||||
w.emitf("const %s %s", obj.Name(), w.typeString(obj.Type()))
|
||||
|
||||
w.emitf("const %s = %s", obj.Name(), obj.Val())
|
||||
case *types.Var:
|
||||
w.emitf("var %s %s", obj.Name(), w.typeString(obj.Type()))
|
||||
|
||||
case *types.TypeName:
|
||||
w.emitType(obj)
|
||||
|
||||
case *types.Func:
|
||||
w.emitFunc(obj)
|
||||
|
||||
default:
|
||||
panic("unknown object: " + obj.String())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue