Skip to content

Commit 1e7f676

Browse files
committed
multi: fix linter issues
1 parent e990c62 commit 1e7f676

File tree

11 files changed

+19
-23
lines changed

11 files changed

+19
-23
lines changed

.golangci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ run:
22
# timeout for analysis
33
deadline: 4m
44

5-
# Linting uses a lot of memory. Keep it under control by only running a single
6-
# worker.
7-
concurrency: 1
8-
95
linters-settings:
106
govet:
117
# Don't report about shadowed variables

bip39/bip39.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func EntropyFromMnemonic(mnemonic string) ([]byte, error) {
6666
b := big.NewInt(0)
6767
for _, v := range mnemonicSlice {
6868
index, found := wordMap[v]
69-
if found == false {
69+
if !found {
7070
return nil, fmt.Errorf("word `%v` not found in "+
7171
"reverse map", v)
7272
}
@@ -106,7 +106,7 @@ func EntropyFromMnemonic(mnemonic string) ([]byte, error) {
106106

107107
func computeChecksum(data []byte) []byte {
108108
hasher := sha256.New()
109-
hasher.Write(data)
109+
_, _ = hasher.Write(data)
110110
return hasher.Sum(nil)
111111
}
112112

bip39/wordlist_english.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"strings"
99
)
1010

11-
func init() {
11+
func init() { //nolint:gochecknoinits
1212
// Ensure word list is correct
1313
// $ wget https://raw.githubusercontent.com/bitcoin/bips/master/bip-0039/english.txt
1414
// $ crc32 english.txt

btc/bitcoind.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ package btc
22

33
import (
44
"fmt"
5-
"github.com/btcsuite/btcd/wire"
65
"io"
76
"time"
87

98
"github.com/btcsuite/btcd/chaincfg"
109
"github.com/btcsuite/btcd/txscript"
10+
"github.com/btcsuite/btcd/wire"
1111
"github.com/btcsuite/btcutil"
1212
"github.com/btcsuite/btcutil/hdkeychain"
1313
"github.com/guggero/chantools/lnd"

btc/fasthd/extendedkey.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import (
1616
)
1717

1818
const (
19-
HardenedKeyStart = 0x80000000 // 2^31
20-
serializedKeyLen = 4 + 1 + 4 + 4 + 32 + 33 // 78 bytes
19+
HardenedKeyStart = 0x80000000 // 2^31
2120
keyLen = 33
2221
)
2322

@@ -50,7 +49,7 @@ func (k *FastDerivation) Child(i uint32) error {
5049
binary.BigEndian.PutUint32(k.scratch[keyLen:], i)
5150

5251
hmac512 := hmac.New(sha512.New, k.chainCode)
53-
hmac512.Write(k.scratch[:])
52+
_, _ = hmac512.Write(k.scratch[:])
5453
ilr := hmac512.Sum(nil)
5554

5655
il := ilr[:len(ilr)/2]
@@ -84,7 +83,7 @@ func NewFastDerivation(seed []byte, net *chaincfg.Params) (*FastDerivation, erro
8483
// First take the HMAC-SHA512 of the master key and the seed data:
8584
// I = HMAC-SHA512(Key = "Bitcoin seed", Data = S)
8685
hmac512 := hmac.New(sha512.New, masterKey)
87-
hmac512.Write(seed)
86+
_, _ = hmac512.Write(seed)
8887
lr := hmac512.Sum(nil)
8988

9089
// Split "I" into two 32-byte sequences Il and Ir where:

cmd/chantools/derivekey.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package main
22

33
import (
44
"fmt"
5-
"github.com/btcsuite/btcutil"
6-
"github.com/guggero/chantools/btc"
75

6+
"github.com/btcsuite/btcutil"
87
"github.com/btcsuite/btcutil/hdkeychain"
8+
"github.com/guggero/chantools/btc"
99
"github.com/guggero/chantools/lnd"
1010
)
1111

cmd/chantools/signrescuefunding.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package main
33
import (
44
"bytes"
55
"fmt"
6-
"github.com/btcsuite/btcd/btcec"
7-
"github.com/btcsuite/btcutil/psbt"
8-
"github.com/lightningnetwork/lnd/keychain"
96

7+
"github.com/btcsuite/btcd/btcec"
108
"github.com/btcsuite/btcutil/hdkeychain"
9+
"github.com/btcsuite/btcutil/psbt"
1110
"github.com/guggero/chantools/lnd"
11+
"github.com/lightningnetwork/lnd/keychain"
1212
)
1313

1414
type signRescueFundingCommand struct {

cmd/chantools/sweeptimelock.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import (
44
"bytes"
55
"encoding/hex"
66
"fmt"
7-
"github.com/btcsuite/btcd/btcec"
8-
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
97

8+
"github.com/btcsuite/btcd/btcec"
109
"github.com/btcsuite/btcd/chaincfg/chainhash"
1110
"github.com/btcsuite/btcd/txscript"
1211
"github.com/btcsuite/btcd/wire"
@@ -15,6 +14,7 @@ import (
1514
"github.com/guggero/chantools/dataformat"
1615
"github.com/guggero/chantools/lnd"
1716
"github.com/lightningnetwork/lnd/input"
17+
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
1818
)
1919

2020
const (

lnd/aezeed.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const (
2121
)
2222

2323
var (
24-
numberDotsRegex = regexp.MustCompile("[\\d.\\-\\n\\r\\t]*")
24+
numberDotsRegex = regexp.MustCompile(`[\d.\-\n\r\t]*`)
2525
multipleSpaces = regexp.MustCompile(" [ ]+")
2626
)
2727

lnd/hdkeychain.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ package lnd
22

33
import (
44
"fmt"
5-
"github.com/btcsuite/btcd/chaincfg/chainhash"
6-
"github.com/btcsuite/btcd/txscript"
7-
"github.com/lightningnetwork/lnd/shachain"
85
"strconv"
96
"strings"
107

118
"github.com/btcsuite/btcd/btcec"
129
"github.com/btcsuite/btcd/chaincfg"
10+
"github.com/btcsuite/btcd/chaincfg/chainhash"
11+
"github.com/btcsuite/btcd/txscript"
1312
"github.com/btcsuite/btcutil"
1413
"github.com/btcsuite/btcutil/hdkeychain"
1514
"github.com/lightningnetwork/lnd/keychain"
15+
"github.com/lightningnetwork/lnd/shachain"
1616
)
1717

1818
const (

0 commit comments

Comments
 (0)