kubernetes/cmd/libs/go2idl/parser
Clayton Coleman 5f9e7a00b8
Add optional slice and map support to protobuf
Specifying // +protobuf.nullable=true on a Go type that is an alias of a
map or slice will generate a synthetic protobuf message with the type
name that will serialize to the wire in a way that allows the difference
between empty and nil to be recorded.

For instance:

    // +protobuf.nullable=true
    types OptionalMap map[string]string

will create the following message:

    message OptionalMap {
      map<string, string> Items = 1
    }

and generate marshallers that use the presence of OptionalMap to
determine whether the map is nil (rather than Items, which protobuf
provides no way to delineate between empty and nil).
2016-06-27 21:42:02 -07:00
..
doc.go First iteration of go2idl. 2015-10-21 09:56:36 -07:00
parse_test.go Add optional slice and map support to protobuf 2016-06-27 21:42:02 -07:00
parse.go Add optional slice and map support to protobuf 2016-06-27 21:42:02 -07:00