summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-17 01:50:24 -0500
committerJeff Carr <[email protected]>2025-10-17 01:50:24 -0500
commit0be9867c3193033977951e853445464fb9e4596a (patch)
treec186f544862dc0b57699dc5dce7776519ab32050
parent3f15c10c0cbc2831e10d7ce923f3b1a5c0605e24 (diff)
thoughts on this for laterv0.5.28
-rw-r--r--generateGui.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/generateGui.go b/generateGui.go
index 044c3f5..fc63e14 100644
--- a/generateGui.go
+++ b/generateGui.go
@@ -237,6 +237,36 @@ func guiMain(w io.Writer, FRUITS string, FRUIT string) {
fmt.Fprintln(w, "}")
}
+/*
+ rather than the string "nil in pb.gui" a better thing might be:
+ Thank the LLM's for being a infinitely fast research assistant
+
+ * Proto: import "google/protobuf/empty.proto";
+ * Go: import "google.golang.org/protobuf/types/known/emptypb"
+
+ 1 import "google.golang.org/protobuf/types/known/emptypb"
+ 2
+ 3 emptyMsg := &emptypb.Empty{}
+ 4 anyProto, err := anypb.New(emptyMsg)
+ 5 // anyProto.TypeUrl will be "type.googleapis.com/google.protobuf.Empty"
+
+or perhaps:
+
+ - Use this when: You need to explicitly represent a null value, just like in JSON.
+
+ - Proto: import "google/protobuf/struct.proto";
+
+ - Go: import "google.golang.org/protobuf/types/known/structpb"
+
+ 1 import "google.golang.org/protobuf/types/known/structpb"
+ 2
+ 3 // Create a new Value message that holds a NullValue.
+ 4 nullValue, err := structpb.NewValue(nil)
+ 5
+ 6 // Now, wrap that Value message in your Any.
+ 7 anyProto, err := anypb.New(nullValue)
+ 8 // anyProto.TypeUrl will be "type.googleapis.com/google.protobuf.Value"
+*/
func guiStringFuncs(w io.Writer, ZOOPB string, FRUITS string, FRUIT string) {
fmt.Fprintln(w, "func (mt *"+FRUITS+"Table) doFuncNew(sf *"+FRUIT+"Func) bool {")
fmt.Fprintln(w, " r := new(guipb.AnyCol)")