Skip to content

Commit

Permalink
fix: raw struct unit test (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
FGYFFFF authored Apr 9, 2024
1 parent 91a39db commit 9463514
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion generator/golang/templates/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
{{- range $Consts}}
{{InsertionPoint "constant" .Name}}
{{- if and Features.ReserveComments .ReservedComments}}{{.ReservedComments}}{{end}}
{{.GoName}} {{.GoTypeName}} = {{.Initialization}}
{{.GoName}} = {{.Initialization}}
{{- end}}{{/* range $Consts */}}
{{InsertionPoint "constants"}}
)
Expand Down
3 changes: 2 additions & 1 deletion generator/golang/templates/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/cloudwego/thriftgo/generator/backend"
"github.com/cloudwego/thriftgo/generator/golang"
"github.com/cloudwego/thriftgo/generator/golang/templates"
"github.com/cloudwego/thriftgo/generator/golang/templates/raw_struct"
)

// forceSingleDefinition panics if the given template contains multiple definition.
Expand Down Expand Up @@ -69,7 +70,7 @@ func TestDefinitionNumber(t *testing.T) {
}
for pkg, tpls := range templates.Alternative() {
for _, tpl := range tpls {
if tpl != templates.File {
if !(tpl == templates.File || tpl == raw_struct.File) { // raw_struct rewrite 'template.File'
forceSingleDefinition(pkg, tpl, funcs)
}
}
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

package version

const ThriftgoVersion = "0.3.9"
const ThriftgoVersion = "0.3.10"

0 comments on commit 9463514

Please sign in to comment.