Snippets for Go test and benchmark functions
This commit is contained in:
parent
4ed409154b
commit
84d9764fb5
@ -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}
|
||||||
|
Loading…
Reference in New Issue
Block a user