diff --git a/gosnippets/UltiSnips/go.snippets b/gosnippets/UltiSnips/go.snippets index 7febcff0d0..c65d3e32f3 100644 --- a/gosnippets/UltiSnips/go.snippets +++ b/gosnippets/UltiSnips/go.snippets @@ -464,6 +464,14 @@ for _, tt := range tests { } endsnippet +# fuzz function +snippet fuzz "func FuzzXYZ(f *testing.F) { ... }" +func Fuzz${1:Function}(f *testing.F) { + f.Fuzz(func(t *testing.T, ${2}) { + ${0:${VISUAL}} + }) +} +endsnippet snippet hf "http.HandlerFunc" func ${1:handler}(w http.ResponseWriter, r *http.Request) { diff --git a/gosnippets/snippets/go.snip b/gosnippets/snippets/go.snip index 08b9e8b51d..17b78304ed 100644 --- a/gosnippets/snippets/go.snip +++ b/gosnippets/snippets/go.snip @@ -340,6 +340,14 @@ abbr var test = {...}{...} for {t.Run(){...}} } }) } +# fuzz function +snippet fuzz +abbr func FuzzXYZ(f *testing.F) { ... } + func Fuzz${1:Function}(f *testing.F) { + f.Fuzz(func(t *testing.T, ${2:ff}) { + ${0} + }) + } # test server snippet tsrv abbr ts := httptest.NewServer(...)