diff --git a/internal/template/method.go b/internal/template/method.go index 8df7b6d9..fe134c68 100644 --- a/internal/template/method.go +++ b/internal/template/method.go @@ -421,12 +421,7 @@ func Test_{{.TargetStruct}}_{{.MethodName}}(t *testing.T) { for i, tt := range {{.OriginStruct.Type}}{{.MethodName}}TestCase { t.Run("{{.MethodName}}_"+strconv.Itoa(i), func(t *testing.T) { - {{if .GetTestResultParamInTmpl}} - {{.GetTestResultParamInTmpl}} := do.{{.MethodName}}({{.GetTestParamInTmpl}}) - {{.GetAssertInTmpl}} - {{else}} - do.{{.MethodName}}({{.GetTestParamInTmpl}}) - {{end}} + {{if .GetTestResultParamInTmpl}}{{.GetTestResultParamInTmpl}} := do.{{.MethodName}}({{.GetTestParamInTmpl}}){{.GetAssertInTmpl}}{{else}}do.{{.MethodName}}({{.GetTestParamInTmpl}}){{end}} }) } }