From e0b4246ff2a9022aff2429d5cce2ca0bc96213dc Mon Sep 17 00:00:00 2001 From: Michael Graff Date: Wed, 13 Dec 2023 22:52:18 -0600 Subject: [PATCH] poke v3 (#2) * poke v3 * fix lint --- .github/workflows/release-and-poke.yml | 2 +- registry_test.go | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-and-poke.yml b/.github/workflows/release-and-poke.yml index 4810f40..778a4e2 100644 --- a/.github/workflows/release-and-poke.yml +++ b/.github/workflows/release-and-poke.yml @@ -12,4 +12,4 @@ jobs: ref: ${{ github.ref_name }} persist-credentials: false - name: prod proxy - run: GOPROXY=proxy.golang.org go list -m github.com/${{ github.repository }}/v2@${{ github.ref_name }} + run: GOPROXY=proxy.golang.org go list -m github.com/${{ github.repository }}/v3@${{ github.ref_name }} 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