multi: Removed deprecated interfacer linter
Removed the deprecated interfacer linter from being called for linting. Also removed the `nolint:interfacer` within the code. https://github.com/lightningnetwork/lnd/issues/5741
This commit is contained in:
1 parent
545e84f4ce
commit
87a0e52464
7 files changed
+21
-47
No files matched your search
@@ -58,6 +58,9 @@ linters:
|
|||||||
# Init functions are used by loggers throughout the codebase.
|
# Init functions are used by loggers throughout the codebase.
|
||||||
- gochecknoinits
|
- gochecknoinits
|
||||||
|
|
||||||
|
# interfacer has been archived.
|
||||||
|
- interfacer
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
# Only show newly introduced problems.
|
# Only show newly introduced problems.
|
||||||
new-from-rev: 01f696afce2f9c0d4ed854edefa3846891d01d8a
|
new-from-rev: 01f696afce2f9c0d4ed854edefa3846891d01d8a
|
||||||
|
|||||||
@@ -882,8 +882,9 @@ func fetchChanBucket(tx kvdb.RTx, nodeKey *btcec.PublicKey,
|
|||||||
// channel's data resides in given: the public key for the node, the outpoint,
|
// channel's data resides in given: the public key for the node, the outpoint,
|
||||||
// and the chainhash that the channel resides on. This differs from
|
// and the chainhash that the channel resides on. This differs from
|
||||||
// fetchChanBucket in that it returns a writeable bucket.
|
// fetchChanBucket in that it returns a writeable bucket.
|
||||||
func fetchChanBucketRw(tx kvdb.RwTx, nodeKey *btcec.PublicKey, // nolint:interfacer
|
func fetchChanBucketRw(tx kvdb.RwTx, nodeKey *btcec.PublicKey,
|
||||||
outPoint *wire.OutPoint, chainHash chainhash.Hash) (kvdb.RwBucket, error) {
|
outPoint *wire.OutPoint, chainHash chainhash.Hash) (kvdb.RwBucket,
|
||||||
|
error) {
|
||||||
|
|
||||||
// First fetch the top level bucket which stores all data related to
|
// First fetch the top level bucket which stores all data related to
|
||||||
// current, active channels.
|
// current, active channels.
|
||||||
|
|||||||
+3
-1
@@ -578,7 +578,9 @@ func (c *ChannelGraph) DisabledChannelIDs() ([]uint64, error) {
|
|||||||
//
|
//
|
||||||
// TODO(roasbeef): add iterator interface to allow for memory efficient graph
|
// TODO(roasbeef): add iterator interface to allow for memory efficient graph
|
||||||
// traversal when graph gets mega
|
// traversal when graph gets mega
|
||||||
func (c *ChannelGraph) ForEachNode(cb func(kvdb.RTx, *LightningNode) error) error { // nolint:interfacer
|
func (c *ChannelGraph) ForEachNode(
|
||||||
|
cb func(kvdb.RTx, *LightningNode) error) error {
|
||||||
|
|
||||||
traversal := func(tx kvdb.RTx) error {
|
traversal := func(tx kvdb.RTx) error {
|
||||||
// First grab the nodes bucket which stores the mapping from
|
// First grab the nodes bucket which stores the mapping from
|
||||||
// pubKey to node information.
|
// pubKey to node information.
|
||||||
|
|||||||
@@ -731,7 +731,9 @@ func fetchPaymentWithSequenceNumber(tx kvdb.RTx, paymentHash lntypes.Hash,
|
|||||||
// DeletePayment deletes a payment from the DB given its payment hash. If
|
// DeletePayment deletes a payment from the DB given its payment hash. If
|
||||||
// failedHtlcsOnly is set, only failed HTLC attempts of the payment will be
|
// failedHtlcsOnly is set, only failed HTLC attempts of the payment will be
|
||||||
// deleted.
|
// deleted.
|
||||||
func (d *DB) DeletePayment(paymentHash lntypes.Hash, failedHtlcsOnly bool) error { // nolint:interfacer
|
func (d *DB) DeletePayment(paymentHash lntypes.Hash,
|
||||||
|
failedHtlcsOnly bool) error {
|
||||||
|
|
||||||
return kvdb.Update(d, func(tx kvdb.RwTx) error {
|
return kvdb.Update(d, func(tx kvdb.RwTx) error {
|
||||||
payments := tx.ReadWriteBucket(paymentsRootBucket)
|
payments := tx.ReadWriteBucket(paymentsRootBucket)
|
||||||
if payments == nil {
|
if payments == nil {
|
||||||
|
|||||||
@@ -1351,7 +1351,6 @@ func (n *NetworkHarness) WaitForChannelClose(
|
|||||||
// an optional set of check functions which can be used to make further
|
// an optional set of check functions which can be used to make further
|
||||||
// assertions using channel's values. These functions are responsible for
|
// assertions using channel's values. These functions are responsible for
|
||||||
// failing the test themselves if they do not pass.
|
// failing the test themselves if they do not pass.
|
||||||
// nolint: interfacer
|
|
||||||
func (n *NetworkHarness) AssertChannelExists(node *HarnessNode,
|
func (n *NetworkHarness) AssertChannelExists(node *HarnessNode,
|
||||||
chanPoint *wire.OutPoint, checks ...func(*lnrpc.Channel)) error {
|
chanPoint *wire.OutPoint, checks ...func(*lnrpc.Channel)) error {
|
||||||
|
|
||||||
|
|||||||
@@ -589,9 +589,8 @@ func shutdownAndAssert(net *lntest.NetworkHarness, t *harnessTest,
|
|||||||
|
|
||||||
// assertChannelBalanceResp makes a ChannelBalance request and checks the
|
// assertChannelBalanceResp makes a ChannelBalance request and checks the
|
||||||
// returned response matches the expected.
|
// returned response matches the expected.
|
||||||
func assertChannelBalanceResp(t *harnessTest,
|
func assertChannelBalanceResp(t *harnessTest, node *lntest.HarnessNode,
|
||||||
node *lntest.HarnessNode,
|
expected *lnrpc.ChannelBalanceResponse) {
|
||||||
expected *lnrpc.ChannelBalanceResponse) { // nolint:interfacer
|
|
||||||
|
|
||||||
resp := getChannelBalance(t, node)
|
resp := getChannelBalance(t, node)
|
||||||
require.True(t.t, proto.Equal(expected, resp), "balance is incorrect")
|
require.True(t.t, proto.Equal(expected, resp), "balance is incorrect")
|
||||||
|
|||||||
+7
-39
@@ -50,32 +50,20 @@ func ErrOutpointIndexTooBig(index uint32) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// WriteBytes appends the given bytes to the provided buffer.
|
// WriteBytes appends the given bytes to the provided buffer.
|
||||||
//
|
func WriteBytes(buf *bytes.Buffer, b []byte) error {
|
||||||
// Note: We intentionally skip the interfacer linter check here because we want
|
|
||||||
// to have concrete type (bytes.Buffer) rather than interface type (io.Write)
|
|
||||||
// due to performance concern.
|
|
||||||
func WriteBytes(buf *bytes.Buffer, b []byte) error { // nolint: interfacer
|
|
||||||
_, err := buf.Write(b)
|
_, err := buf.Write(b)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteUint8 appends the uint8 to the provided buffer.
|
// WriteUint8 appends the uint8 to the provided buffer.
|
||||||
//
|
func WriteUint8(buf *bytes.Buffer, n uint8) error {
|
||||||
// Note: We intentionally skip the interfacer linter check here because we want
|
|
||||||
// to have concrete type (bytes.Buffer) rather than interface type (io.Write)
|
|
||||||
// due to performance concern.
|
|
||||||
func WriteUint8(buf *bytes.Buffer, n uint8) error { // nolint: interfacer
|
|
||||||
_, err := buf.Write([]byte{n})
|
_, err := buf.Write([]byte{n})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteUint16 appends the uint16 to the provided buffer. It encodes the
|
// WriteUint16 appends the uint16 to the provided buffer. It encodes the
|
||||||
// integer using big endian byte order.
|
// integer using big endian byte order.
|
||||||
//
|
func WriteUint16(buf *bytes.Buffer, n uint16) error {
|
||||||
// Note: We intentionally skip the interfacer linter check here because we want
|
|
||||||
// to have concrete type (bytes.Buffer) rather than interface type (io.Write)
|
|
||||||
// due to performance concern.
|
|
||||||
func WriteUint16(buf *bytes.Buffer, n uint16) error { // nolint: interfacer
|
|
||||||
var b [2]byte
|
var b [2]byte
|
||||||
binary.BigEndian.PutUint16(b[:], n)
|
binary.BigEndian.PutUint16(b[:], n)
|
||||||
_, err := buf.Write(b[:])
|
_, err := buf.Write(b[:])
|
||||||
@@ -93,11 +81,7 @@ func WriteUint32(buf *bytes.Buffer, n uint32) error {
|
|||||||
|
|
||||||
// WriteUint64 appends the uint64 to the provided buffer. It encodes the
|
// WriteUint64 appends the uint64 to the provided buffer. It encodes the
|
||||||
// integer using big endian byte order.
|
// integer using big endian byte order.
|
||||||
//
|
func WriteUint64(buf *bytes.Buffer, n uint64) error {
|
||||||
// Note: We intentionally skip the interfacer linter check here because we want
|
|
||||||
// to have concrete type (bytes.Buffer) rather than interface type (io.Write)
|
|
||||||
// due to performance concern.
|
|
||||||
func WriteUint64(buf *bytes.Buffer, n uint64) error { // nolint: interfacer
|
|
||||||
var b [8]byte
|
var b [8]byte
|
||||||
binary.BigEndian.PutUint64(b[:], n)
|
binary.BigEndian.PutUint64(b[:], n)
|
||||||
_, err := buf.Write(b[:])
|
_, err := buf.Write(b[:])
|
||||||
@@ -194,13 +178,7 @@ func WriteFailCode(buf *bytes.Buffer, e FailCode) error {
|
|||||||
// WriteRawFeatureVector encodes the feature using the feature's Encode method
|
// WriteRawFeatureVector encodes the feature using the feature's Encode method
|
||||||
// and appends the data to the provided buffer. An error will return if the
|
// and appends the data to the provided buffer. An error will return if the
|
||||||
// passed feature is nil.
|
// passed feature is nil.
|
||||||
//
|
func WriteRawFeatureVector(buf *bytes.Buffer, feature *RawFeatureVector) error {
|
||||||
// Note: We intentionally skip the interfacer linter check here because we want
|
|
||||||
// to have concrete type (bytes.Buffer) rather than interface type (io.Write)
|
|
||||||
// due to performance concern.
|
|
||||||
func WriteRawFeatureVector(buf *bytes.Buffer, // nolint: interfacer
|
|
||||||
feature *RawFeatureVector) error {
|
|
||||||
|
|
||||||
if feature == nil {
|
if feature == nil {
|
||||||
return ErrNilFeatureVector
|
return ErrNilFeatureVector
|
||||||
}
|
}
|
||||||
@@ -280,11 +258,7 @@ func WriteBool(buf *bytes.Buffer, b bool) error {
|
|||||||
|
|
||||||
// WritePkScript appends the script to the provided buffer. Returns an error if
|
// WritePkScript appends the script to the provided buffer. Returns an error if
|
||||||
// the provided script exceeds 34 bytes.
|
// the provided script exceeds 34 bytes.
|
||||||
//
|
func WritePkScript(buf *bytes.Buffer, s PkScript) error {
|
||||||
// Note: We intentionally skip the interfacer linter check here because we want
|
|
||||||
// to have concrete type (bytes.Buffer) rather than interface type (io.Write)
|
|
||||||
// due to performance concern.
|
|
||||||
func WritePkScript(buf *bytes.Buffer, s PkScript) error { // nolint: interfacer
|
|
||||||
// The largest script we'll accept is a p2wsh which is exactly
|
// The largest script we'll accept is a p2wsh which is exactly
|
||||||
// 34 bytes long.
|
// 34 bytes long.
|
||||||
scriptLength := len(s)
|
scriptLength := len(s)
|
||||||
@@ -412,13 +386,7 @@ func WriteNetAddrs(buf *bytes.Buffer, addresses []net.Addr) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// writeDataWithLength writes the data and its length to the buffer.
|
// writeDataWithLength writes the data and its length to the buffer.
|
||||||
//
|
func writeDataWithLength(buf *bytes.Buffer, data []byte) error {
|
||||||
// Note: We intentionally skip the interfacer linter check here because we want
|
|
||||||
// to have concrete type (bytes.Buffer) rather than interface type (io.Write)
|
|
||||||
// due to performance concern.
|
|
||||||
func writeDataWithLength(buf *bytes.Buffer, // nolint: interfacer
|
|
||||||
data []byte) error {
|
|
||||||
|
|
||||||
var l [2]byte
|
var l [2]byte
|
||||||
binary.BigEndian.PutUint16(l[:], uint16(len(data)))
|
binary.BigEndian.PutUint16(l[:], uint16(len(data)))
|
||||||
if _, err := buf.Write(l[:]); err != nil {
|
if _, err := buf.Write(l[:]); err != nil {
|
||||||
|
|||||||
Reference in new issue
Block a user