lnd: partially fix golint warnings

This commit is contained in:
Andrey Samokhvalov authored and Olaoluwa Osuntokun committed 2017-03-13 16:30:23 -07:00
1 parent 92dec2a902
commit fd97a4bd19
38 files changed
+229 -233

No files matched your search

+1 -1
View File
@@ -212,7 +212,7 @@ func fileExists(path string) bool {
return true
}
// FetchOpenChannel returns all stored currently active/open channels
// FetchOpenChannels returns all stored currently active/open channels
// associated with the target nodeID. In the case that no active channels are
// known to have been created with this node, then a zero-length slice is
// returned.
+2 -2
View File
@@ -627,7 +627,7 @@ func TestGraphTraversal(t *testing.T) {
if !c.Node.PubKey.IsEqual(secondNode.PubKey) {
return fmt.Errorf("wrong outgoing edge")
}
numNodeChans += 1
numNodeChans++
return nil
})
if err != nil {
@@ -663,7 +663,7 @@ func asserNumChans(t *testing.T, graph *ChannelGraph, n int) {
if err := graph.ForEachChannel(func(*ChannelEdgeInfo, *ChannelEdgePolicy,
*ChannelEdgePolicy) error {
numChans += 1
numChans++
return nil
}); err != nil {
_, _, line, _ := runtime.Caller(1)
+2 -2
View File
@@ -27,7 +27,7 @@ func TestVersionFetchPut(t *testing.T) {
t.Fatal("initialization of meta information wasn't performed")
}
var newVersion uint32 = getLatestDBVersion(dbVersions) + 1
newVersion := getLatestDBVersion(dbVersions) + 1
meta.DbVersionNumber = newVersion
if err := db.PutMeta(meta); err != nil {
@@ -261,7 +261,7 @@ func TestMigrationWithFatal(t *testing.T) {
}
bucket.Put(keyPrefix, afterMigration)
return errors.New("some error!")
return errors.New("some error")
}
// Check that version of database and initial data wasn't changed.
+4 -4
View File
@@ -69,7 +69,7 @@ func (db *DB) AddPayment(payment *OutgoingPayment) error {
}
// Obtain the new unique sequence number for this payment.
paymentId, err := payments.NextSequence()
paymentID, err := payments.NextSequence()
if err != nil {
return err
}
@@ -77,10 +77,10 @@ func (db *DB) AddPayment(payment *OutgoingPayment) error {
// We use BigEndian for keys as it orders keys in
// ascending order. This allows bucket scans to order payments
// in the order in which they were created.
paymentIdBytes := make([]byte, 8)
binary.BigEndian.PutUint64(paymentIdBytes, paymentId)
paymentIDBytes := make([]byte, 8)
binary.BigEndian.PutUint64(paymentIDBytes, paymentID)
return payments.Put(paymentIdBytes, paymentBytes)
return payments.Put(paymentIDBytes, paymentBytes)
})
}