From f3f8f4557d0119bd1f26538fa5691f2aeaaf0114 Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Thu, 24 Jun 2021 11:34:07 -0700 Subject: [PATCH] Update go snippet --- go/.config/vim/snips/go.snippets | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/go/.config/vim/snips/go.snippets b/go/.config/vim/snips/go.snippets index 19ca2f7..2050d38 100644 --- a/go/.config/vim/snips/go.snippets +++ b/go/.config/vim/snips/go.snippets @@ -10,15 +10,32 @@ endsnippet snippet test "setup test case" ! func Test${1}(t *testing.T) { type testcase struct { - name string - setup func(tc *testcase) + Name string + Setup func(tc *testcase) } tt := []testcase{} for _, tc := range tt { tc := tc - t.Run(tc.name, func(t *testing.T) { + t.Run(tc.Name, func(t *testing.T) { t.Parallel() - tc.setup(&tc) + tc.Setup(&tc) + }) + } +} +endsnippet +snippet htest "setup hellotech test case" ! +func Test${1}(t *testing.T) { + type testcase struct { + Name string + Setup func(tc *testcase) + } + tt := []testcase{} + for _, tc := range tt { + tc := tc + t.Run(tc.Name, func(t *testing.T) { + ctx, a, ctrl := cutils.Test(t) + t.Parallel() + tc.Setup(&tc) }) } }