remove debugging printf

This commit is contained in:
Jeff Carr 2025-02-21 05:41:17 -06:00
parent 68eea60f16
commit 0c764d07e4
1 changed files with 18 additions and 12 deletions

View File

@ -86,52 +86,58 @@ func guiMain(w io.Writer, FRUITS string, FRUIT string) {
fmt.Fprintln(w, " return t")
fmt.Fprintln(w, "}")
fmt.Fprintln(w, "")
fmt.Fprintln(w, "func (t *"+FRUITS+"Table) AddStringFunc(title string, f func(*"+FRUIT+") string) {")
fmt.Fprintln(w, "func (t *"+FRUITS+"Table) AddStringFunc(title string, f func(*"+FRUIT+") string) *"+FRUIT+"StringFunc {")
fmt.Fprintln(w, " t.pb.Order = append(t.pb.Order, title)")
fmt.Fprintln(w, "")
fmt.Fprintln(w, " sf := new("+FRUIT+"StringFunc)")
fmt.Fprintln(w, " sf.title = title")
fmt.Fprintln(w, " sf.f = f")
fmt.Fprintln(w, " t.stringFuncs = append(t.stringFuncs, sf)")
fmt.Fprintln(w, " return sf")
fmt.Fprintln(w, "}")
fmt.Fprintln(w, "func (t *"+FRUITS+"Table) AddIntFunc(title string, f func(*"+FRUIT+") int) {")
fmt.Fprintln(w, "func (t *"+FRUITS+"Table) AddIntFunc(title string, f func(*"+FRUIT+") int) *"+FRUIT+"IntFunc {")
fmt.Fprintln(w, " t.pb.Order = append(t.pb.Order, title)")
fmt.Fprintln(w, "")
fmt.Fprintln(w, " sf := new("+FRUIT+"IntFunc)")
fmt.Fprintln(w, " sf.title = title")
fmt.Fprintln(w, " sf.f = f")
fmt.Fprintln(w, " t.intFuncs = append(t.intFuncs, sf)")
fmt.Fprintln(w, " return sf")
fmt.Fprintln(w, "}")
fmt.Fprintln(w, "")
fmt.Fprintln(w, "func (t *"+FRUITS+"Table) AddTimeFunc(title string, f func(*"+FRUIT+") time.Time) {")
fmt.Fprintln(w, "func (t *"+FRUITS+"Table) AddTimeFunc(title string, f func(*"+FRUIT+") time.Time) *"+FRUIT+"TimeFunc {")
fmt.Fprintln(w, " t.pb.Order = append(t.pb.Order, title)")
fmt.Fprintln(w, "")
fmt.Fprintln(w, " sf := new("+FRUIT+"TimeFunc)")
fmt.Fprintln(w, " sf.title = title")
fmt.Fprintln(w, " sf.f = f")
fmt.Fprintln(w, " t.timeFuncs = append(t.timeFuncs, sf)")
fmt.Fprintln(w, " return sf")
fmt.Fprintln(w, "}")
fmt.Fprintln(w, "")
fmt.Fprintln(w, "func (mt *"+FRUITS+"Table) ShowTable() {")
fmt.Fprintln(w, " log.Info(\"ShowTable() SENDING TO GUI\")")
fmt.Fprintln(w, " // log.Info(\"ShowTable() SENDING TO GUI\")")
fmt.Fprintln(w, " mt.MakeTable()")
fmt.Fprintln(w, " gui.ShowTable(mt.pb)")
fmt.Fprintln(w, "}")
fmt.Fprintln(w, "")
fmt.Fprintln(w, "type "+FRUIT+"StringFunc struct {")
fmt.Fprintln(w, " title string")
fmt.Fprintln(w, " f func(*"+FRUIT+") string")
fmt.Fprintln(w, " f func(*"+FRUIT+") string")
fmt.Fprintln(w, " Custom func(*"+FRUIT+")")
fmt.Fprintln(w, "}")
fmt.Fprintln(w, "")
fmt.Fprintln(w, "type "+FRUIT+"IntFunc struct {")
fmt.Fprintln(w, " title string")
fmt.Fprintln(w, " f func(*"+FRUIT+") int")
fmt.Fprintln(w, " Custom func(*"+FRUIT+")")
fmt.Fprintln(w, "}")
fmt.Fprintln(w, "")
fmt.Fprintln(w, "type "+FRUIT+"TimeFunc struct {")
fmt.Fprintln(w, " title string")
fmt.Fprintln(w, " f func(*"+FRUIT+") time.Time")
fmt.Fprintln(w, " Custom func(*"+FRUIT+")")
fmt.Fprintln(w, "}")
fmt.Fprintln(w, "")
fmt.Fprintln(w, "type "+FRUITS+"Table struct {")
@ -151,7 +157,7 @@ func guiStringFuncs(w io.Writer, ZOOPB string, FRUITS string, FRUIT string) {
fmt.Fprintln(w, " if sf.title != name {")
fmt.Fprintln(w, " continue")
fmt.Fprintln(w, " }")
fmt.Fprintln(w, " log.Info(\""+ZOOPB+": found stringfunc name:\", name)")
fmt.Fprintln(w, " // log.Info(\""+ZOOPB+": found stringfunc name:\", name)")
fmt.Fprintln(w, " r := new(guipb.StringRow)")
fmt.Fprintln(w, " r.Header = new(guipb.Widget)")
fmt.Fprintln(w, " r.Header.Name = name")
@ -159,7 +165,7 @@ func guiStringFuncs(w io.Writer, ZOOPB string, FRUITS string, FRUIT string) {
fmt.Fprintln(w, " for all.Scan() {")
fmt.Fprintln(w, " m := all.Next()")
fmt.Fprintln(w, " r.Vals = append(r.Vals, sf.f(m))")
fmt.Fprintln(w, " log.Info(\""+ZOOPB+": adding\", name, r.Vals)")
fmt.Fprintln(w, " // log.Info(\""+ZOOPB+": adding\", name, r.Vals)")
fmt.Fprintln(w, " }")
fmt.Fprintln(w, " mt.pb.StringRows = append(mt.pb.StringRows, r)")
fmt.Fprintln(w, " return true")
@ -172,7 +178,7 @@ func guiStringFuncs(w io.Writer, ZOOPB string, FRUITS string, FRUIT string) {
fmt.Fprintln(w, " if sf.title != name {")
fmt.Fprintln(w, " continue")
fmt.Fprintln(w, " }")
fmt.Fprintln(w, " log.Info(\""+ZOOPB+": found intfunc name:\", name)")
fmt.Fprintln(w, " // log.Info(\""+ZOOPB+": found intfunc name:\", name)")
fmt.Fprintln(w, " r := new(guipb.IntRow)")
fmt.Fprintln(w, " r.Header = new(guipb.Widget)")
fmt.Fprintln(w, " r.Header.Name = name")
@ -180,7 +186,7 @@ func guiStringFuncs(w io.Writer, ZOOPB string, FRUITS string, FRUIT string) {
fmt.Fprintln(w, " for all.Scan() {")
fmt.Fprintln(w, " m := all.Next()")
fmt.Fprintln(w, " r.Vals = append(r.Vals, int64(sf.f(m)))")
fmt.Fprintln(w, " log.Info(\""+ZOOPB+": adding\", name, r.Vals)")
fmt.Fprintln(w, " // log.Info(\""+ZOOPB+": adding\", name, r.Vals)")
fmt.Fprintln(w, " }")
fmt.Fprintln(w, " mt.pb.IntRows = append(mt.pb.IntRows, r)")
fmt.Fprintln(w, " return true")
@ -193,7 +199,7 @@ func guiStringFuncs(w io.Writer, ZOOPB string, FRUITS string, FRUIT string) {
fmt.Fprintln(w, " if sf.title != name {")
fmt.Fprintln(w, " continue")
fmt.Fprintln(w, " }")
fmt.Fprintln(w, " log.Info(\""+ZOOPB+": found timefunc name:\", name)")
fmt.Fprintln(w, " // log.Info(\""+ZOOPB+": found timefunc name:\", name)")
fmt.Fprintln(w, " r := new(guipb.TimeRow)")
fmt.Fprintln(w, " r.Header = new(guipb.Widget)")
fmt.Fprintln(w, " r.Header.Name = name")
@ -202,7 +208,7 @@ func guiStringFuncs(w io.Writer, ZOOPB string, FRUITS string, FRUIT string) {
fmt.Fprintln(w, " m := all.Next()")
fmt.Fprintln(w, " t := sf.f(m)")
fmt.Fprintln(w, " r.Vals = append(r.Vals, timestamppb.New(t)) // convert to protobuf time")
fmt.Fprintln(w, " log.Info(\""+ZOOPB+": adding\", name, r.Vals)")
fmt.Fprintln(w, " // log.Info(\""+ZOOPB+": adding\", name, r.Vals)")
fmt.Fprintln(w, " }")
fmt.Fprintln(w, " mt.pb.TimeRows = append(mt.pb.TimeRows, r)")
fmt.Fprintln(w, " return true")
@ -212,7 +218,7 @@ func guiStringFuncs(w io.Writer, ZOOPB string, FRUITS string, FRUIT string) {
fmt.Fprintln(w, "")
fmt.Fprintln(w, "func (mt *"+FRUITS+"Table) MakeTable() {")
fmt.Fprintln(w, " for _, name := range mt.pb.Order {")
fmt.Fprintln(w, " log.Info(\""+ZOOPB+": looking for row name()\", name)")
fmt.Fprintln(w, " // log.Info(\""+ZOOPB+": looking for row name()\", name)")
fmt.Fprintln(w, " if mt.doStringFunc(name) {")
fmt.Fprintln(w, " continue")
fmt.Fprintln(w, " }")