Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snippets for Example and Benchmark #836

Merged
merged 1 commit into from
May 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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