Snippets for Go test and benchmark functions

This commit is contained in:
Miki Tebeka 2014-05-17 07:11:35 +03:00
parent 4ed409154b
commit 84d9764fb5

View File

@ -230,3 +230,17 @@ snippet ga
go func(${1} ${2:type}) { go func(${1} ${2:type}) {
${3:/* code */} ${3:/* code */}
}(${0}) }(${0})
# test function
snippet tst
func Test${1:name}(t *testing.T) {
${2}
}
${0}
# benchmark function
snippet bnch
func Benchmark${1:name}(b *testing.B) {
for i := 0; i < b.N; i++ {
${2}
}
}
${0}