strings as 'any' now
This commit is contained in:
parent
b53d68d6b8
commit
f2978a0605
|
@ -144,6 +144,14 @@ func getAnyCell(t *guipb.Table, name string, row int) (string, bool) {
|
||||||
switch col.Attr.Type {
|
switch col.Attr.Type {
|
||||||
case guipb.ColAttr_STRING:
|
case guipb.ColAttr_STRING:
|
||||||
// return col.Vals[row] true
|
// return col.Vals[row] true
|
||||||
|
// Assume 'anyVal' is an element from your r.Vals slice
|
||||||
|
var stringValue wrapperspb.StringValue
|
||||||
|
if err := anyVal.UnmarshalTo(&stringValue); err == nil {
|
||||||
|
// It's a string, now convert it back to a native Go string
|
||||||
|
goString := stringValue.GetValue()
|
||||||
|
// fmt.Printf("Successfully unpacked string: %s\n", goString)
|
||||||
|
return goString, true
|
||||||
|
}
|
||||||
case guipb.ColAttr_INT:
|
case guipb.ColAttr_INT:
|
||||||
var finalInt int32
|
var finalInt int32
|
||||||
// 1. Check if the Any contains an Int32Value
|
// 1. Check if the Any contains an Int32Value
|
||||||
|
|
Loading…
Reference in New Issue