protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Ability to change values in Enum_name map.

Open bm0 opened this issue 5 years ago • 0 comments

Hello! Is there ability to change values in generated for my enum Kind map Kind_name map[int32]string ?

For example:

kind.proto

enum Kind {
    KindUndefined = 0;
    KindErasure   = 1;
    KindExport    = 2;
}

Generates kind.pb.go with bellow content:

const (
	KindUndefined Kind = 0
	KindErasure   Kind = 1
	KindExport    Kind = 2
)

var Kind_name = map[int32]string{
	0: "KindUndefined",
	1: "KindErasure",
	2: "KindExport",
}

I tried to do it with enumvalue_customname extension, but it changed only names of constants, values in map remained unchanged. There is any way to change values in Kind_name map?

bm0 avatar Jan 30 '20 14:01 bm0