diff options
Diffstat (limited to 'human.go')
| -rw-r--r-- | human.go | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/human.go b/human.go new file mode 100644 index 0000000..0aebb80 --- /dev/null +++ b/human.go @@ -0,0 +1,41 @@ +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) + } +} |
