forked from cerc-io/laconicd-deprecated
lint
This commit is contained in:
+1
-2
@@ -36,7 +36,6 @@ func GenerateHash(json map[string]interface{}) (string, []byte, error) {
|
||||
return "", nil, err
|
||||
}
|
||||
|
||||
//cid, err := CIDFromJSONBytes(content)
|
||||
cidString, err := CIDFromJSONBytesUsingIpldPrime(content)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
@@ -81,7 +80,7 @@ func CIDFromJSONBytesUsingIpldPrime(content []byte) (string, error) {
|
||||
// This gathers together any parameters that might be needed when making a link.
|
||||
// (For CIDs, the version, the codec, and the multihash type are all parameters we'll need.)
|
||||
// Often, you can probably make this a constant for your whole application.
|
||||
lp := cidlink.LinkPrototype{Prefix: cid.Prefix{
|
||||
lp := cidlink.LinkPrototype{Prefix: cid.Prefix{ //nolint:golint
|
||||
Version: 1, // Usually '1'.
|
||||
Codec: 0x71, // 0x71 means "dag-cbor" -- See the multicodecs table: https://github.com/multiformats/multicodec/
|
||||
MhType: 0x12, // 0x12 means "sha2-256" -- See the multicodecs table: https://github.com/multiformats/multicodec/
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ func GenerateMnemonic() (string, error) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
mnemonic, err := bip39.NewMnemonic(entropySeed[:])
|
||||
mnemonic, err := bip39.NewMnemonic(entropySeed)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
+6
-3
@@ -12,10 +12,13 @@ import (
|
||||
set "github.com/deckarep/golang-set"
|
||||
)
|
||||
|
||||
func Int64ToBytes(num int64) []byte {
|
||||
func Int64ToBytes(num int64) ([]byte, error) {
|
||||
buf := new(bytes.Buffer)
|
||||
binary.Write(buf, binary.BigEndian, num)
|
||||
return buf.Bytes()
|
||||
if err := binary.Write(buf, binary.BigEndian, num); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
func SetToSlice(set set.Set) []string {
|
||||
|
||||
Reference in New Issue
Block a user