From 94fa2cccbacbcbbedb332cd5409dc58998b9406d Mon Sep 17 00:00:00 2001 From: Tyler Smith Date: Fri, 16 Aug 2024 22:17:03 -0400 Subject: [PATCH 1/2] fix: Propagate error from rand.Read, which can fail in some rare cases. --- bip39.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bip39.go b/bip39.go index 2ef9833..dc49b73 100644 --- a/bip39.go +++ b/bip39.go @@ -104,7 +104,10 @@ func NewEntropy(bitSize int) ([]byte, error) { } entropy := make([]byte, bitSize/8) - _, _ = rand.Read(entropy) // err is always nil + _, err := rand.Read(entropy) + if err != nil { + return nil, err + } return entropy, nil } From 498d05a45b531c70681c935d38e86b3b9825d265 Mon Sep 17 00:00:00 2001 From: Tyler Smith Date: Fri, 16 Aug 2024 22:35:57 -0400 Subject: [PATCH 2/2] ci: Update actions workflow and remove coveralls. --- .github/workflows/workflow.yml | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 8cae732..4735a2a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,36 +1,27 @@ ---- - name: build-check on: [push, pull_request] jobs: build-check: name: Run build-check on Go ${{ matrix.go }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: go: + - '1.22' + - '1.21' + - '1.20' + - '1.19' + - '1.18' + - '1.17' + - '1.16' - '1.15' - '1.14' - '1.13' - '1.12' - '1.11' steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} - run: make build_check - save-test-coverage: - name: Save test coverage - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v1 - with: - go-version: 1.15 - - name: Get test coverage - run: make tests - - name: Send coverage - uses: shogo82148/actions-goveralls@v1 - with: - path-to-profile: coverage.out