diff options
Diffstat (limited to 'generate.go')
| -rw-r--r-- | generate.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/generate.go b/generate.go index e1ef396..8c53297 100644 --- a/generate.go +++ b/generate.go @@ -240,7 +240,7 @@ func (pb *Files) makeNewSortfile(pf *File) error { // find() for _, v := range msg.Vars { - if v.VarType != "string" { + if !(v.VarType == "string" || (v.VarType == "int64")) { continue } if v.IsRepeated { @@ -254,13 +254,15 @@ func (pb *Files) makeNewSortfile(pf *File) error { // special case because of the enforced .proto format FUNCNAME = "FindBy" + v.VarName funcdef := pmsg.generateFindBy(wSort, FUNCNAME, PARENT, s, v) - // func (msg *MsgName) generateFindBy(w io.Writer, FUNCNAME, STRUCT, VARNAME, VARTYPE, COLOR string) string { log.Printf("Adding %s\n", funcdef) - } else { - // deprecate these - FUNCNAME = "Find" + VARNAME + "By" + v.VarName - } + FRUITS := PARENT + FRUIT := s.VarType + APPLE := v.VarName + COLOR := v.VarType + funcdef = pmsg.insertBy(wSort, FRUITS, FRUIT, APPLE, COLOR) + log.Printf("Adding %s\n", funcdef) + } } else { if v.VarType == "string" { // probably dumb. move to a database if you need this |
