mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -305,6 +305,21 @@ 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}(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
${0}
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
# variable declaration
|
||||
snippet var
|
||||
abbr var x Type [= ...]
|
||||
@ -323,3 +338,15 @@ abbr equals: test two identifiers with DeepEqual
|
||||
fmt.Printf("%s:%d:\n\n\texp: %#v\n\n\tgot: %#v\n\n", filepath.Base(file), line, $1, $2)
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
snippet hf
|
||||
abbr http.HandlerFunc
|
||||
func ${1:handler}(w http.ResponseWriter, r *http.Request) {
|
||||
${0:fmt.Fprintf(w, "hello world")}
|
||||
}
|
||||
|
||||
snippet hhf
|
||||
abbr mux.HandleFunc(...)
|
||||
${1:http}.HandleFunc("${2:/}", func(w http.ResponseWriter, r *http.Request) {
|
||||
${0:fmt.Fprintf(w, "hello world")}
|
||||
})
|
||||
|
Reference in New Issue
Block a user