Skip to content

Commit

Permalink
fix staticcheck reports
Browse files Browse the repository at this point in the history
  • Loading branch information
altergui committed Mar 9, 2023
1 parent 727c965 commit f2328b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion data/ipfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"time"

ipfscid "github.com/ipfs/go-cid"
files "github.com/ipfs/go-ipfs-files"
keystore "github.com/ipfs/go-ipfs-keystore"
files "github.com/ipfs/go-libipfs/files"
ipfslog "github.com/ipfs/go-log"
coreiface "github.com/ipfs/interface-go-ipfs-core"
"github.com/ipfs/interface-go-ipfs-core/options"
Expand Down
9 changes: 7 additions & 2 deletions rpcclient/util.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package rpcclient

import (
"crypto/rand"
"encoding/hex"
"encoding/json"
"fmt"
"math/rand"
"math/big"
"os"
"time"

Expand Down Expand Up @@ -269,7 +270,11 @@ func genVote(encrypted bool, keys []string) ([]byte, error) {
return nil, fmt.Errorf("cannot decode encryption key with index %d: (%s)", i, err)
}
if first {
vp.Nonce = RandomHex(rand.Intn(16) + 16)
randInt, err := rand.Int(rand.Reader, big.NewInt(16))
if err != nil {
return nil, err
}
vp.Nonce = RandomHex(int(randInt.Int64()) + 16)
vpBytes, err = json.Marshal(vp)
if err != nil {
return nil, err
Expand Down

0 comments on commit f2328b3

Please sign in to comment.