Skip to content

Commit

Permalink
gocryptfs -speed: call testing.Init() to fix panic
Browse files Browse the repository at this point in the history
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: #789
Relates-to: golang/go#62666
  • Loading branch information
rfjakob committed Sep 15, 2023
1 parent 7fff33a commit 44e3635
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/speed/speed.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 44e3635

Please sign in to comment.