diff options
| author | Jeff Carr <[email protected]> | 2025-01-10 23:55:12 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-10 23:55:12 -0600 |
| commit | 51a326c5d75ac1635de92bf2636f5050326b459e (patch) | |
| tree | 23ff99a7f6601e50f24733935669c287afd45ea7 /sort.go | |
| parent | f3297022a8ed73db93842311d4b1429e8f69e8c7 (diff) | |
still testing
Diffstat (limited to 'sort.go')
| -rw-r--r-- | sort.go | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -47,6 +47,8 @@ func (pb *Files) makeNewSortfile(pf *File) error { pf.findFunc(wFind) */ + pf.specialBases(wSort, wFind) + // attempt to add sort functions for pf.Base if err := pf.processMessage(pf.Bases, wSort, wFind); err != nil { return err @@ -57,6 +59,15 @@ func (pb *Files) makeNewSortfile(pf *File) error { return nil } +func (pf *File) specialBases(wSort, wFind io.Writer) { + var FRUIT string = cases.Title(language.English, cases.NoLower).String(pf.Bases.Name) + var APPLES string = cases.Title(language.English, cases.NoLower).String(pf.Bases.Name) + var APPLE string = cases.Title(language.English, cases.NoLower).String(pf.Base.Name) + + pf.Bases.simpleAppend(wFind, FRUIT, APPLES, APPLE) + +} + // to simplify being able to read the code, FRUIT, APPLES and APPLE are used // FRUIT == the string name of the message in the protobuf file // APPLE == the type of the repeated variable @@ -93,7 +104,6 @@ func (pf *File) processMessage(msg *MsgName, wSort, wFind io.Writer) error { log.Printf("FOUND: %s %s for %s\n", APPLES, APPLE, FRUIT) - found.simpleAppend(wFind, FRUIT, APPLES, APPLE) found.addAppendByMsg(wFind, FRUIT, APPLES, APPLE) found.addDeleteByMsg(wFind, FRUIT, APPLES, APPLE) found.addInsertByMsg(wFind, FRUIT, APPLES, APPLE) // new idea |
