From 379fb1fa42edca578c0f5cdf2ac3ac54e8684967 Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Fri, 30 Apr 2021 13:10:34 -0700 Subject: [PATCH] Add go snips --- go/.config/vim/snips/go.snippets | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/go/.config/vim/snips/go.snippets b/go/.config/vim/snips/go.snippets index a50a3ce..19ca2f7 100644 --- a/go/.config/vim/snips/go.snippets +++ b/go/.config/vim/snips/go.snippets @@ -5,5 +5,21 @@ snippet ctx "context" ! ctx context.Context endsnippet snippet e "error wrapper" ! -e := wrap(".") +e := wrap(".${1}") +endsnippet +snippet test "setup 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) { + t.Parallel() + tc.setup(&tc) + }) + } +} endsnippet