|
|
@ -5,5 +5,21 @@ snippet ctx "context" !
|
|
|
|
ctx context.Context
|
|
|
|
ctx context.Context
|
|
|
|
endsnippet
|
|
|
|
endsnippet
|
|
|
|
snippet e "error wrapper" !
|
|
|
|
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
|
|
|
|
endsnippet
|
|
|
|