From 7cd4766d5e8bd9cc41b57c87be29aa34f988e0f7 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Fri, 7 May 2021 21:38:18 -0700 Subject: [PATCH] types/wgkey: add BenchmarkShortString Signed-off-by: Josh Bleecher Snyder --- types/wgkey/key_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/types/wgkey/key_test.go b/types/wgkey/key_test.go index 1c4c2da59..c4bfa93da 100644 --- a/types/wgkey/key_test.go +++ b/types/wgkey/key_test.go @@ -171,3 +171,13 @@ func BenchmarkUnmarshalJSON(b *testing.B) { } } } + +var sinkString string + +func BenchmarkShortString(b *testing.B) { + b.ReportAllocs() + var k Key + for i := 0; i < b.N; i++ { + sinkString = k.ShortString() + } +}