From 503d8ff2a9a1243577326b0916a26be36fe588fa Mon Sep 17 00:00:00 2001 From: Michael Graff Date: Wed, 13 Dec 2023 22:50:33 -0600 Subject: [PATCH] fix lint --- registry_test.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/registry_test.go b/registry_test.go index c1e707e..b35c8eb 100644 --- a/registry_test.go +++ b/registry_test.go @@ -34,7 +34,13 @@ import ( func GenerateSymmetricKey() []byte { sharedKey := make([]byte, 64) - rand.Read(sharedKey) + n, err := rand.Read(sharedKey) + if err != nil { + log.Fatalln(err) + } + if n != len(sharedKey) { + log.Fatal("rand.Rand did not return the correct number of bytes") + } return sharedKey } @@ -53,7 +59,10 @@ func TestRegister(t *testing.T) { if err != nil { log.Fatalf("cannot generate key: %v", err) } - keyset.AddKey(key) + err = keyset.AddKey(key) + if err != nil { + log.Fatalf("cannot add key: %v", err) + } type args struct { purpose string