3 ms·
If you use gogoproto, it includes an extension to the protobuf spec, to override json tag for the emitted Go. https://github.com/gogo/protobuf/blob/master/exten
by LukeShu 7y ago
If you use gogoproto, it includes an extension to the protobuf spec, to override json tag for the emitted Go. https://github.com/gogo/protobuf/blob/master/extensions.md https://github.com/gogo/protobuf/blob/master/extensions.md
Use it like:
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
...
Type myField = 1 [(gogoproto.jsontag) = "my-field"];