mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Fix protobuf generation for empty struct
This commit is contained in:
parent
56e62b684e
commit
f519a9b65c
@ -112,6 +112,9 @@ func isProtoable(seen map[*types.Type]bool, t *types.Type) bool {
|
|||||||
case types.Map:
|
case types.Map:
|
||||||
return isProtoable(seen, t.Key) && isProtoable(seen, t.Elem)
|
return isProtoable(seen, t.Key) && isProtoable(seen, t.Elem)
|
||||||
case types.Struct:
|
case types.Struct:
|
||||||
|
if len(t.Members) == 0 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
for _, m := range t.Members {
|
for _, m := range t.Members {
|
||||||
if isProtoable(seen, m.Type) {
|
if isProtoable(seen, m.Type) {
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user