You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
469 B
Plaintext
26 lines
469 B
Plaintext
snippet ignore "ignore function" !
|
|
func(...interface{}) {}(${1})
|
|
endsnippet
|
|
snippet ctx "context" !
|
|
ctx context.Context
|
|
endsnippet
|
|
snippet e "error wrapper" !
|
|
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
|