Skip to content

Commit

Permalink
Snippets for Example and Benchmark (#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
codeinabox authored and fatih committed May 3, 2016
1 parent 5a846f3 commit ff70ed5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions gosnippets/UltiSnips/go.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
13 changes: 13 additions & 0 deletions gosnippets/snippets/go.snip
Original file line number Diff line number Diff line change
Expand Up @@ -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 [= ...]
Expand Down

0 comments on commit ff70ed5

Please sign in to comment.