Skip to content

Commit

Permalink
fix: fix dyn-enum
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkgos committed Dec 26, 2024
1 parent def2652 commit 1851e13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/protoc-gen-dyn-enum/enum.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

// Enum value mapping for {{$enumName}}.
var (
__{{$enumName}}Mapping_Desc = map[{{$enumName}}]string{
__{{$enumName}}Mapping_Label = map[{{$enumName}}]string{
{{- range $ee := $e.Values}}
{{if $ee.IsDuplicate}}// Duplicate value: {{end}}{{$ee.Number}}: "{{$ee.Mapping}}",
{{- end}}
Expand All @@ -46,10 +46,10 @@ func (x {{$enumName}}) IntoNumberString() string {
return strconv.FormatInt(int64(x), 10)
}

// MappingDescriptor mapping description.
// MappingLabel mapping label.
{{$e.Comment}}
func (x {{$enumName}}) MappingDescriptor() string {
return __{{$enumName}}Mapping_Desc[x]
func (x {{$enumName}}) MappingLabel() string {
return __{{$enumName}}Mapping_Label[x]
}

// EnumCount the number of enum values.
Expand Down

0 comments on commit 1851e13

Please sign in to comment.