Skip to content

Commit debd257

Browse files
committed
Merge pull request honza#367 from tebeka/go-test
Go: test and benchmark functions snippets.
2 parents 4ed4091 + 9548538 commit debd257

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

snippets/go.snippets

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,15 @@ snippet ga
230230
go func(${1} ${2:type}) {
231231
${3:/* code */}
232232
}(${0})
233+
snippet test test function
234+
func Test${1:name}(t *testing.T) {
235+
${2}
236+
}
237+
${0}
238+
snippet bench benchmark function
239+
func Benchmark${1:name}(b *testing.B) {
240+
for i := 0; i < b.N; i++ {
241+
${2}
242+
}
243+
}
244+
${0}

0 commit comments

Comments
 (0)