Skip to content

Commit

Permalink
Fix protobuf generation for empty struct
Browse files Browse the repository at this point in the history
Kubernetes-commit: f519a9b65c4b7b588a339f9b7dd9fd37f2e4dac8
  • Loading branch information
nikhita authored and k8s-publish-robot committed Nov 17, 2017
1 parent 0c3fe41 commit dafce78
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/go-to-protobuf/protobuf/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ func isProtoable(seen map[*types.Type]bool, t *types.Type) bool {
case types.Map:
return isProtoable(seen, t.Key) && isProtoable(seen, t.Elem)
case types.Struct:
if len(t.Members) == 0 {
return true
}
for _, m := range t.Members {
if isProtoable(seen, m.Type) {
return true
Expand Down

0 comments on commit dafce78

Please sign in to comment.