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:
naveen
2021-12-13 15:32:23 +01:00
committed by Oliver Gugger
parent 545e84f4ce
commit 87a0e52464
7 changed files with 21 additions and 47 deletions

View File

@@ -50,32 +50,20 @@ func ErrOutpointIndexTooBig(index uint32) error {
}
// WriteBytes appends the given bytes to the provided buffer.
//
// 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
func WriteBytes(buf *bytes.Buffer, b []byte) error {
_, err := buf.Write(b)
return err
}
// WriteUint8 appends the uint8 to the provided buffer.
//
// 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
func WriteUint8(buf *bytes.Buffer, n uint8) error {
_, err := buf.Write([]byte{n})
return err
}
// WriteUint16 appends the uint16 to the provided buffer. It encodes the
// integer using big endian byte order.
//
// 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
func WriteUint16(buf *bytes.Buffer, n uint16) error {
var b [2]byte
binary.BigEndian.PutUint16(b[:], n)
_, 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
// integer using big endian byte order.
//
// 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
func WriteUint64(buf *bytes.Buffer, n uint64) error {
var b [8]byte
binary.BigEndian.PutUint64(b[:], n)
_, 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
// and appends the data to the provided buffer. An error will return if the
// passed feature is nil.
//
// 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 {
func WriteRawFeatureVector(buf *bytes.Buffer, feature *RawFeatureVector) error {
if feature == nil {
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
// the provided script exceeds 34 bytes.
//
// 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
func WritePkScript(buf *bytes.Buffer, s PkScript) error {
// The largest script we'll accept is a p2wsh which is exactly
// 34 bytes long.
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.
//
// 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 {
func writeDataWithLength(buf *bytes.Buffer, data []byte) error {
var l [2]byte
binary.BigEndian.PutUint16(l[:], uint16(len(data)))
if _, err := buf.Write(l[:]); err != nil {