diff options
| author | Jeff Carr <[email protected]> | 2025-01-10 19:37:32 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-10 19:37:32 -0600 |
| commit | 22651438692cf991be22d8898e5727f586fd2f11 (patch) | |
| tree | b7e4936ca077f315af8d49908d0c14a5a1791411 /human.go | |
| parent | dc86ae010f688eefc5f4757d1c6eb620effc68f9 (diff) | |
correctly identify the two primary structs
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) + } +} |
