From ce411f8e22d31ba3ace7a9b883e41677d2cc262c Mon Sep 17 00:00:00 2001 From: Philip Hayes Date: Sun, 7 May 2017 14:58:53 -0700 Subject: [PATCH] lint: fix linter complaints --- breacharbiter_test.go | 6 +++--- lnwallet/witnessgen.go | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/breacharbiter_test.go b/breacharbiter_test.go index 92034b07..4ab15193 100644 --- a/breacharbiter_test.go +++ b/breacharbiter_test.go @@ -231,7 +231,7 @@ func initBreachedOutputs() error { sd := &breachSignDescs[i] pubkey, err := btcec.ParsePubKey(breachKeys[i], btcec.S256()) if err != nil { - fmt.Errorf("unable to parse pubkey: %v", breachKeys[i]) + return fmt.Errorf("unable to parse pubkey: %v", breachKeys[i]) } sd.PubKey = pubkey bo.signDescriptor = sd @@ -303,7 +303,7 @@ func TestRetributionSerialization(t *testing.T) { // callback which cleans up the created temporary directories is also returned // and intended to be executed after the test completes. func makeTestDB() (*channeldb.DB, func(), error) { - var db *channeldb.DB = nil + var db *channeldb.DB // First, create a temporary directory to be used for the duration of // this test. @@ -331,7 +331,7 @@ func makeTestDB() (*channeldb.DB, func(), error) { func countRetributions(t *testing.T, rs *retributionStore) int { count := 0 err := rs.ForAll(func(_ *retribution) error { - count += 1 + count++ return nil }) if err != nil { diff --git a/lnwallet/witnessgen.go b/lnwallet/witnessgen.go index 77fd6995..42e92fc3 100644 --- a/lnwallet/witnessgen.go +++ b/lnwallet/witnessgen.go @@ -13,16 +13,17 @@ import ( type WitnessType uint16 const ( - // Witness that allows us to spend the output of a commitment transaction - // after a relative lock-time lockout. + // CommitmentTimeLock is a witness that allows us to spend the output of a + // commitment transaction after a relative lock-time lockout. CommitmentTimeLock WitnessType = 0 - // Witness that allows us to spend a settled no-delay output immediately on - // a counterparty's commitment transaction. + // CommitmentNoDelay is a witness that allows us to spend a settled no-delay + // output immediately on a counterparty's commitment transaction. CommitmentNoDelay WitnessType = 1 - // Witness that allows us to sweep the settled output of a malicious - // counterparty's who broadcasts a revoked commitment transaction. + // CommitmentRevoke is a witness that allows us to sweep the settled output + // of a malicious counterparty's who broadcasts a revoked commitment + // transaction. CommitmentRevoke WitnessType = 2 )