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 [= ...]