diff options
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 |
