Skip to content

Commit

Permalink
perf: enum type add go:generate stringer comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lbbniu committed Jun 24, 2023
1 parent 61dee6d commit 7c0708c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tars/tools/tars2go/gencode/gen_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@ func (g *GenGo) genEnum(en *ast.EnumInfo) {

en.Rename()

g.P("//go:generate stringer -type " + en.Name + " -trimprefix " + en.Name + "_ -output " + strings.ToLower(en.Name) + "_string.go")
g.P("type ", en.Name, " int32")
g.P("const (")
var it int32
Expand Down

0 comments on commit 7c0708c

Please sign in to comment.