From 3b58e3234dc9bde4711beb6e1c4b673c4f78ebe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kowalak?= Date: Thu, 24 Nov 2016 14:40:23 +0100 Subject: [PATCH] Add benchmark function snippet --- snippets/go.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/snippets/go.json b/snippets/go.json index 713c54630..346f46ea6 100644 --- a/snippets/go.json +++ b/snippets/go.json @@ -156,6 +156,10 @@ "prefix": "tf", "body": "func Test$1(t *testing.T) {\n\t$0\n}" }, + "benchmark function": { + "prefix": "bf", + "body": "func Benchmark$1(b *testing.B) {\n\tfor ${2:i} := 0; ${2:i} < b.N; ${2:i}++ {\n\t\t$0\n\t}\n}" + }, "init function": { "prefix": "finit", "body": "func init() {\n\t$1\n}"