You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JPFARIA-MacBook-Pro:server jpfaria$ go run main.go
gitlab.b2w/joao.faria/knativegrpcexample
../generated.pb.go:288:6: m.XXX_unrecognized undefined (type *User has no field or method XXX_unrecognized)
../generated.pb.go:289:24: m.XXX_unrecognized undefined (type *User has no field or method XXX_unrecognized)
../generated.pb.go:351:6: m.XXX_unrecognized undefined (type *User has no field or method XXX_unrecognized)
../generated.pb.go:352:13: m.XXX_unrecognized undefined (type *User has no field or method XXX_unrecognized)
../generated.pb.go:564:5: m.XXX_unrecognized undefined (type *User has no field or method XXX_unrecognized)
The text was updated successfully, but these errors were encountered:
Seeing as it now seems like the XXX_unrecognized field should be in the struct (ie, they would be in the struct if you used protoc to generate all of your Go code), I found that simply adding it to the struct worked for me. If you want to keep your structs clean of protobuf-specific fields, I found a not-so-bad workaround, of wrapping it in another struct, like this:
//proteus:generate
type PBPersonWrapper struct {
Person
XXX_unrecognized []byte
}
type Person struct {
Name string
Age uint
}
hello,
when I run my app, the follow error is returning:
JPFARIA-MacBook-Pro:server jpfaria$ go run main.go
gitlab.b2w/joao.faria/knativegrpcexample
../generated.pb.go:288:6: m.XXX_unrecognized undefined (type *User has no field or method XXX_unrecognized)
../generated.pb.go:289:24: m.XXX_unrecognized undefined (type *User has no field or method XXX_unrecognized)
../generated.pb.go:351:6: m.XXX_unrecognized undefined (type *User has no field or method XXX_unrecognized)
../generated.pb.go:352:13: m.XXX_unrecognized undefined (type *User has no field or method XXX_unrecognized)
../generated.pb.go:564:5: m.XXX_unrecognized undefined (type *User has no field or method XXX_unrecognized)
The text was updated successfully, but these errors were encountered: