From cab21b2b6cd8edb66021751587b32307f4ae9330 Mon Sep 17 00:00:00 2001 From: tr1v3r Date: Tue, 16 Jan 2024 23:58:03 +0800 Subject: [PATCH] fix: remove assert code when result param is empty fix: remove verbose blank line fix: error --- internal/template/method.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/template/method.go b/internal/template/method.go index e5d0b95d..5263166e 100644 --- a/internal/template/method.go +++ b/internal/template/method.go @@ -421,8 +421,8 @@ 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) { - {{.GetTestResultParamInTmpl}} := do.{{.MethodName}}({{.GetTestParamInTmpl}}) - {{.GetAssertInTmpl}} + {{if .GetTestResultParamInTmpl}}{{.GetTestResultParamInTmpl}} := do.{{.MethodName}}({{.GetTestParamInTmpl}}) + {{.GetAssertInTmpl}}{{else}}do.{{.MethodName}}({{.GetTestParamInTmpl}}){{end}} }) } }