From 84d9764fb5ad305317e2b95b002cea25a0e4a3be Mon Sep 17 00:00:00 2001 From: Miki Tebeka Date: Sat, 17 May 2014 07:11:35 +0300 Subject: [PATCH 1/3] Snippets for Go test and benchmark functions --- snippets/go.snippets | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/snippets/go.snippets b/snippets/go.snippets index 0239a3f..9d51e33 100644 --- a/snippets/go.snippets +++ b/snippets/go.snippets @@ -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} From fb0a6fc758b3950948708aea68c6778628790e12 Mon Sep 17 00:00:00 2001 From: Miki Tebeka Date: Sun, 18 May 2014 07:49:08 +0300 Subject: [PATCH 2/3] Better name --- snippets/go.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/go.snippets b/snippets/go.snippets index 9d51e33..86be140 100644 --- a/snippets/go.snippets +++ b/snippets/go.snippets @@ -231,13 +231,13 @@ snippet ga ${3:/* code */} }(${0}) # test function -snippet tst +snippet test func Test${1:name}(t *testing.T) { ${2} } ${0} # benchmark function -snippet bnch +snippet bench func Benchmark${1:name}(b *testing.B) { for i := 0; i < b.N; i++ { ${2} From 954853816a225f0e3afb5a6404ba8684a53aa811 Mon Sep 17 00:00:00 2001 From: Miki Tebeka Date: Sun, 18 May 2014 12:57:53 +0300 Subject: [PATCH 3/3] description after trigger --- snippets/go.snippets | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/snippets/go.snippets b/snippets/go.snippets index 86be140..8623eda 100644 --- a/snippets/go.snippets +++ b/snippets/go.snippets @@ -230,14 +230,12 @@ snippet ga go func(${1} ${2:type}) { ${3:/* code */} }(${0}) -# test function -snippet test +snippet test test function func Test${1:name}(t *testing.T) { ${2} } ${0} -# benchmark function -snippet bench +snippet bench benchmark function func Benchmark${1:name}(b *testing.B) { for i := 0; i < b.N; i++ { ${2}