Skip to content

Commit e6b2530

Browse files
authored
Merge pull request lightningnetwork#6731 from guggero/linter-upgrade
tools: upgrade linter version to v1.46.2
2 parents af97b8f + b0d85c4 commit e6b2530

File tree

7 files changed

+237
-131
lines changed

7 files changed

+237
-131
lines changed

.golangci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ linters:
108108
- contextcheck
109109
- errname
110110
- exhaustivestruct
111+
- exhaustruct
111112
- goerr113
112113
- gomnd
113114
- ifshort

contractcourt/nursery_store.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ func (ns *NurseryStore) GraduateKinder(height uint32, kid *kidOutput) error {
531531
// FetchClass returns a list of the kindergarten and crib outputs whose timeouts
532532
// are expiring
533533
func (ns *NurseryStore) FetchClass(
534-
height uint32) ([]kidOutput, []babyOutput, error) { // nolint:golint
534+
height uint32) ([]kidOutput, []babyOutput, error) { // nolint:revive
535535

536536
// Construct list of all crib and kindergarten outputs that need to be
537537
// processed at the provided block height.
@@ -592,7 +592,7 @@ func (ns *NurseryStore) FetchClass(
592592

593593
// FetchPreschools returns a list of all outputs currently stored in the
594594
// preschool bucket.
595-
func (ns *NurseryStore) FetchPreschools() ([]kidOutput, error) { // nolint:golint
595+
func (ns *NurseryStore) FetchPreschools() ([]kidOutput, error) { // nolint:revive
596596
var kids []kidOutput
597597
if err := kvdb.View(ns.db, func(tx kvdb.RTx) error {
598598
// Retrieve the existing chain bucket for this nursery store.
+13-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
# Release Notes
22

33
## Misc
4-
* Warning messages from peers are now recognized and [logged](https://github.com/lightningnetwork/lnd/pull/6546) by lnd.
4+
* Warning messages from peers are now recognized and
5+
[logged](https://github.com/lightningnetwork/lnd/pull/6546) by lnd.
56

67
* [Fixed error typo](https://github.com/lightningnetwork/lnd/pull/6659).
78

8-
* [The macaroon key store implementation was refactored to be more generally useable](https://github.com/lightningnetwork/lnd/pull/6509).
9+
* [The macaroon key store implementation was refactored to be more generally
10+
usable](https://github.com/lightningnetwork/lnd/pull/6509).
11+
12+
## Code Health
13+
14+
### Tooling and documentation
15+
16+
* [The `golangci-lint` tool was updated to
17+
`v1.46.2`](https://github.com/lightningnetwork/lnd/pull/6731)
918

1019
# Contributors (Alphabetical Order)
20+
1121
* Carla Kirk-Cohen
1222
* ErikEk
1323
* Olaoluwa Osuntokun
24+
* Oliver Gugger

lnrpc/marshall_utils.go

+11-12
Original file line numberDiff line numberDiff line change
@@ -147,28 +147,27 @@ func MarshalUtxos(utxos []*lnwallet.Utxo, activeNetParams *chaincfg.Params) (
147147

148148
// MarshallOutputType translates a txscript.ScriptClass into a
149149
// lnrpc.OutputScriptType.
150-
func MarshallOutputType(o txscript.ScriptClass) (ret OutputScriptType) {
150+
func MarshallOutputType(o txscript.ScriptClass) OutputScriptType {
151151
// Translate txscript ScriptClass type to the proper gRPC proto
152152
// output script type.
153153
switch o {
154-
case txscript.PubKeyHashTy:
155-
ret = OutputScriptType_SCRIPT_TYPE_PUBKEY_HASH
156154
case txscript.ScriptHashTy:
157-
ret = OutputScriptType_SCRIPT_TYPE_SCRIPT_HASH
155+
return OutputScriptType_SCRIPT_TYPE_SCRIPT_HASH
158156
case txscript.WitnessV0PubKeyHashTy:
159-
ret = OutputScriptType_SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH
157+
return OutputScriptType_SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH
160158
case txscript.WitnessV0ScriptHashTy:
161-
ret = OutputScriptType_SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH
159+
return OutputScriptType_SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH
162160
case txscript.PubKeyTy:
163-
ret = OutputScriptType_SCRIPT_TYPE_PUBKEY
161+
return OutputScriptType_SCRIPT_TYPE_PUBKEY
164162
case txscript.MultiSigTy:
165-
ret = OutputScriptType_SCRIPT_TYPE_MULTISIG
163+
return OutputScriptType_SCRIPT_TYPE_MULTISIG
166164
case txscript.NullDataTy:
167-
ret = OutputScriptType_SCRIPT_TYPE_NULLDATA
165+
return OutputScriptType_SCRIPT_TYPE_NULLDATA
168166
case txscript.NonStandardTy:
169-
ret = OutputScriptType_SCRIPT_TYPE_NON_STANDARD
167+
return OutputScriptType_SCRIPT_TYPE_NON_STANDARD
170168
case txscript.WitnessUnknownTy:
171-
ret = OutputScriptType_SCRIPT_TYPE_WITNESS_UNKNOWN
169+
return OutputScriptType_SCRIPT_TYPE_WITNESS_UNKNOWN
170+
default:
171+
return OutputScriptType_SCRIPT_TYPE_PUBKEY_HASH
172172
}
173-
return
174173
}

lnwallet/transactions_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ type testContext struct {
6060

6161
// newTestContext populates a new testContext struct with the constant
6262
// parameters defined in the BOLT 03 spec.
63-
func newTestContext(t *testing.T) (tc *testContext) {
64-
tc = new(testContext)
63+
func newTestContext(t *testing.T) *testContext {
64+
tc := new(testContext)
6565

6666
priv := func(v string) *btcec.PrivateKey {
6767
k, err := privkeyFromHex(v)

tools/go.mod

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ require (
66
github.com/btcsuite/btcd v0.23.1
77
github.com/dvyukov/go-fuzz v0.0.0-20210602112143-b1f3d6f4ef4e
88
github.com/elazarl/go-bindata-assetfs v1.0.1 // indirect
9-
github.com/golangci/golangci-lint v1.44.0
9+
github.com/golangci/golangci-lint v1.46.2
1010
github.com/ory/go-acc v0.2.6
1111
github.com/rinchsan/gosimports v0.1.5
1212
github.com/stephens2424/writerset v1.0.2 // indirect
1313
)
14-
15-
// Can be removed once this version is included in golangci-lint.
16-
replace github.com/ultraware/whitespace => github.com/ultraware/whitespace v0.0.5

0 commit comments

Comments
 (0)