Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
feat: add annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkgos committed Dec 26, 2023
1 parent a37621b commit 81c648b
Show file tree
Hide file tree
Showing 19 changed files with 804 additions and 168 deletions.
4 changes: 2 additions & 2 deletions cmd/protoc-gen-saber-enum/enum.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (x {{$enumName}}) IntoNumberString() string {
}

// MappingDescriptor mapping description.
// {{$e.Comment}}
{{$e.Comment}}
func (x {{$enumName}}) MappingDescriptor() string {
return __{{$enumName}}Mapping_Desc[x]
}
Expand All @@ -58,7 +58,7 @@ func ({{$enumName}}) EnumCount() int {
}

// Get{{$enumName}}Value get mapping value
// {{$e.Comment}}
{{$e.Comment}}
func Get{{$enumName}}Value(s string) int {
return int(__{{$enumName}}Mapping_Value[s])
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/protoc-gen-saber-enum/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"google.golang.org/protobuf/compiler/protogen"
)

const version = "v0.0.8"
const version = "v1.0.0"

var args = &struct {
ShowVersion bool // 显示版本
Expand Down
2 changes: 1 addition & 1 deletion cmd/protoc-gen-saber-seaql/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"google.golang.org/protobuf/compiler/protogen"
)

const version = "v0.0.5"
const version = "v1.0.0"

var args = &struct {
ShowVersion bool // 显示当前版本
Expand Down
21 changes: 20 additions & 1 deletion example/enums/mapper.example.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

130 changes: 94 additions & 36 deletions example/enums/nested.mapping.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 81c648b

Please sign in to comment.