Skip to content

Commit

Permalink
Snippets for Go test and benchmark functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tebeka committed May 17, 2014
1 parent 4ed4091 commit 84d9764
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions snippets/go.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,17 @@ snippet ga
go func(${1} ${2:type}) {
${3:/* code */}
}(${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}

0 comments on commit 84d9764

Please sign in to comment.