42 lines
642 B
Go
42 lines
642 B
Go
package main
|
|
|
|
import (
|
|
"go.wit.com/log"
|
|
)
|
|
|
|
// print the protobuf in human form
|
|
func (pf *File) printMsgTable() {
|
|
pf.Bases.printMsg()
|
|
pf.Base.printMsg()
|
|
|
|
// everything else
|
|
for _, msg := range pf.MsgNames {
|
|
msg.printMsg()
|
|
}
|
|
}
|
|
|
|
func (msg *MsgName) printMsg() {
|
|
var s string
|
|
if msg.DoMutex {
|
|
s += "(mutex) "
|
|
}
|
|
if msg.DoMarshal {
|
|
s += "(marshal) "
|
|
}
|
|
log.Printf("%s %s\n", msg.Name, s)
|
|
|
|
for _, v := range msg.Vars {
|
|
var end string
|
|
if v.IsRepeated {
|
|
end += "(repeated) "
|
|
}
|
|
if v.HasSort {
|
|
end += "(sort) "
|
|
}
|
|
if v.HasUnique {
|
|
end += "(unique) "
|
|
}
|
|
log.Printf("\t%s %s %s\n", v.VarName, v.VarType, end)
|
|
}
|
|
}
|