Skip to content

Commit 7c4ba79

Browse files
committed
fix: fix return type instantiation in testcase
1 parent 936bf0e commit 7c4ba79

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

templates/go/api_test.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ func Test_{{packageName}}_{{classname}}Service(t *testing.T) {
4141
{{/returnFormat}}
4242
{{^returnFormat}}
4343
{{#returnType}}
44+
{{#returnTypeIsPrimitive}}
45+
var data {{{.}}}
46+
{{/returnTypeIsPrimitive}}
47+
{{^returnTypeIsPrimitive}}
4448
data := {{{.}}}{}
49+
{{/returnTypeIsPrimitive}}
4550
w.Header().Add("Content-Type", "application/json")
4651
json.NewEncoder(w).Encode(data)
4752
{{/returnType}}

0 commit comments

Comments
 (0)