From 790475dcf09aaa0fc31e1cf7f2f62eef6fe2be3f Mon Sep 17 00:00:00 2001 From: Mathew Attlee Date: Tue, 3 May 2016 14:53:53 +0100 Subject: [PATCH] Snippets for Example and Benchmark --- gosnippets/UltiSnips/go.snippets | 13 +++++++++++++ gosnippets/snippets/go.snip | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/gosnippets/UltiSnips/go.snippets b/gosnippets/UltiSnips/go.snippets index 03d632f887..898cc9cd0e 100644 --- a/gosnippets/UltiSnips/go.snippets +++ b/gosnippets/UltiSnips/go.snippets @@ -363,6 +363,19 @@ if err != nil { } endsnippet +snippet example "func ExampleXYZ() { ... }" +func Example${1:Method}() { + ${0:${VISUAL}} + // Output: +} +endsnippet + +snippet benchmark "func BenchmarkXYZ() { ... }" +func Benchmark${1:Method}() { + ${0:${VISUAL}} +} +endsnippet + # variable declaration snippet var "var x Type [= ...]" var ${1:x} ${2:Type}${3: = ${0:value}} diff --git a/gosnippets/snippets/go.snip b/gosnippets/snippets/go.snip index 6e512f9308..e08aa8916b 100644 --- a/gosnippets/snippets/go.snip +++ b/gosnippets/snippets/go.snip @@ -305,6 +305,19 @@ abbr if err != nil { t.Fatalf(...) } if err != nil { t.Fatalf("${1}") } +# test example +snippet example +func Example${1:Method}() { + ${0} + // Output: +} +endsnippet +# test benchmark +snippet benchmark +func Benchmark${1:Method}() { + ${0} +} +endsnippet # variable declaration snippet var abbr var x Type [= ...]