From 44e3635cf6e914025b2e1e032312ef5b8aafe258 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Fri, 15 Sep 2023 23:11:58 +0200 Subject: gocryptfs -speed: call testing.Init() to fix panic Looks like I should have been calling testing.Init() all along. From https://pkg.go.dev/testing#Init : > Init is only needed when calling functions such as > Benchmark without using "go test". Fixes: https://github.com/rfjakob/gocryptfs/issues/789 Relates-to: https://github.com/golang/go/issues/62666 --- internal/speed/speed.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/speed/speed.go b/internal/speed/speed.go index 47fe8c9..a361cf5 100644 --- a/internal/speed/speed.go +++ b/internal/speed/speed.go @@ -48,6 +48,7 @@ func Run() { {name: cryptocore.BackendXChaCha20Poly1305OpenSSL.String(), f: bStupidXchacha, preferred: stupidgcm.PreferOpenSSLXchacha20poly1305()}, {name: cryptocore.BackendXChaCha20Poly1305.String(), f: bXchacha20poly1305, preferred: !stupidgcm.PreferOpenSSLXchacha20poly1305()}, } + testing.Init() for _, b := range bTable { fmt.Printf("%-26s\t", b.name) mbs := mbPerSec(testing.Benchmark(b.f)) -- cgit v1.2.3