summaryrefslogtreecommitdiff
path: root/generate.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-09 09:30:17 -0500
committerJeff Carr <[email protected]>2025-03-09 09:30:17 -0500
commit4f881d17c02a9d239aa8b2320607318df1c0d2fa (patch)
treef8303c14d524ea08e250170162c07bb756d21db7 /generate.go
parent7f03282acaf7a5f7746ee46a52ac5bafa818f876 (diff)
add InsertBy() functionsv0.0.64
Diffstat (limited to 'generate.go')
-rw-r--r--generate.go14
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