From a594f05e7319db8baa5b42f9c5bbd81efe83e940 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Thu, 23 Feb 2023 11:32:16 +0100 Subject: [PATCH] multi: fix linter issues --- .golangci.yml | 4 ++++ btc/bip39.go | 2 +- cmd/chantools/root.go | 4 ++-- lnd/aezeed.go | 2 +- lnd/graph.go | 4 ++-- lnd/signer.go | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 9778ed9..15ad4f3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -53,6 +53,10 @@ linters: - scopelint - golint - exhaustivestruct + - nosnakecase + - deadcode + - structcheck + - varcheck issues: exclude-rules: diff --git a/btc/bip39.go b/btc/bip39.go index c7bed1f..b3695be 100644 --- a/btc/bip39.go +++ b/btc/bip39.go @@ -83,7 +83,7 @@ func ReadMnemonicFromTerminal(params *chaincfg.Params) (*hdkeychain.ExtendedKey, fmt.Printf("Input your cipher seed passphrase (press enter " + "if your seed doesn't have a passphrase): ") passphraseBytes, err = terminal.ReadPassword( - int(syscall.Stdin), // nolint + int(syscall.Stdin), //nolint ) if err != nil { return nil, err diff --git a/cmd/chantools/root.go b/cmd/chantools/root.go index e63720c..76831d2 100644 --- a/cmd/chantools/root.go +++ b/cmd/chantools/root.go @@ -240,9 +240,9 @@ func readInput(input string) ([]byte, error) { func passwordFromConsole(userQuery string) ([]byte, error) { // Read from terminal (if there is one). - if terminal.IsTerminal(int(syscall.Stdin)) { // nolint + if terminal.IsTerminal(int(syscall.Stdin)) { //nolint fmt.Print(userQuery) - pw, err := terminal.ReadPassword(int(syscall.Stdin)) // nolint + pw, err := terminal.ReadPassword(int(syscall.Stdin)) //nolint if err != nil { return nil, err } diff --git a/lnd/aezeed.go b/lnd/aezeed.go index a8a7556..d9b46e7 100644 --- a/lnd/aezeed.go +++ b/lnd/aezeed.go @@ -89,7 +89,7 @@ func ReadAezeed(params *chaincfg.Params) (*hdkeychain.ExtendedKey, time.Time, "if your seed doesn't have a passphrase): ") var err error passphraseBytes, err = terminal.ReadPassword( - int(syscall.Stdin), // nolint + int(syscall.Stdin), //nolint ) if err != nil { return nil, time.Unix(0, 0), err diff --git a/lnd/graph.go b/lnd/graph.go index d6ba993..7cd4761 100644 --- a/lnd/graph.go +++ b/lnd/graph.go @@ -9,7 +9,7 @@ import ( func AllNodeChannels(graph *lnrpc.ChannelGraph, nodePubKey string) []*lnrpc.ChannelEdge { - var result []*lnrpc.ChannelEdge // nolint:prealloc + var result []*lnrpc.ChannelEdge //nolint:prealloc for _, edge := range graph.Edges { if edge.Node1Pub != nodePubKey && edge.Node2Pub != nodePubKey { continue @@ -24,7 +24,7 @@ func AllNodeChannels(graph *lnrpc.ChannelGraph, func FindCommonEdges(graph *lnrpc.ChannelGraph, node1, node2 string) []*lnrpc.ChannelEdge { - var result []*lnrpc.ChannelEdge // nolint:prealloc + var result []*lnrpc.ChannelEdge //nolint:prealloc for _, edge := range graph.Edges { if edge.Node1Pub != node1 && edge.Node2Pub != node1 { continue diff --git a/lnd/signer.go b/lnd/signer.go index ffd814d..ffb62b9 100644 --- a/lnd/signer.go +++ b/lnd/signer.go @@ -127,7 +127,7 @@ func maybeTweakPrivKey(signDesc *input.SignDescriptor, // k is our private key, and P is the public key, we perform the following // operation: // -// sx := k*P s := sha256(sx.SerializeCompressed()) +// sx := k*P s := sha256(sx.SerializeCompressed()) func ECDH(privKey *btcec.PrivateKey, pub *btcec.PublicKey) ([32]byte, error) { var ( pubJacobian btcec.JacobianPoint