You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The following field will take on the custom name and the prefix, joined
// by an underscore.
MyCustomEnum_MyBetterNameAMyCustomEnum=0
MyCustomEnum_BMyCustomEnum=1
)
varMyCustomEnum_name=map[int32]string{
0: "A",
1: "B",
}
varMyCustomEnum_value=map[string]int32{
"A": 0,
"B": 1,
}
In the above example, line 43 in the "enumcustomname.proto" file uses the "enumvalue_customname" extension to customize the name of the enumeration value. In the 34th page of "enumcustomname.pb.go", the variable name is the name of a custom enumeration value. However, lines 39 and 44 have not been replaced with custom enumeration names.
But I think the generated code should be like this:
const (
// The following field will take on the custom name and the prefix, joined// by an underscore.MyCustomEnum_MyBetterNameAMyCustomEnum=0MyCustomEnum_BMyCustomEnum=1
)
varMyCustomEnum_name=map[int32]string{
0: "MyBetterNameA",
1: "B",
}
varMyCustomEnum_value=map[string]int32{
"MyBetterNameA": 0,
"B": 1,
}
The text was updated successfully, but these errors were encountered:
This is the official test case:
protobuf/test/enumcustomname/enumcustomname.proto
Lines 38 to 45 in b03c65e
protobuf/test/enumcustomname/enumcustomname.pb.go
Lines 31 to 47 in b03c65e
In the above example, line 43 in the "enumcustomname.proto" file uses the "enumvalue_customname" extension to customize the name of the enumeration value. In the 34th page of "enumcustomname.pb.go", the variable name is the name of a custom enumeration value. However, lines 39 and 44 have not been replaced with custom enumeration names.
But I think the generated code should be like this:
The text was updated successfully, but these errors were encountered: