From 0340cef13c339963ca7e0ee37b2974236923bf88 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Tue, 17 Dec 2019 15:37:09 +0100 Subject: [PATCH] Fix linting errors --- api/types_test.go | 22 +++++++++++----------- api/worker.go | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/api/types_test.go b/api/types_test.go index f2f29791..b8d24c3e 100644 --- a/api/types_test.go +++ b/api/types_test.go @@ -66,7 +66,7 @@ func TestBalanceHistories_SortAndAggregate(t *testing.T) { { name: "one", a: []BalanceHistory{ - BalanceHistory{ + { ReceivedSat: (*Amount)(big.NewInt(1)), SentSat: (*Amount)(big.NewInt(2)), Time: 1521514812, @@ -76,7 +76,7 @@ func TestBalanceHistories_SortAndAggregate(t *testing.T) { }, groupByTime: 3600, want: []BalanceHistory{ - BalanceHistory{ + { ReceivedSat: (*Amount)(big.NewInt(1)), SentSat: (*Amount)(big.NewInt(2)), Time: 1521514800, @@ -87,42 +87,42 @@ func TestBalanceHistories_SortAndAggregate(t *testing.T) { { name: "aggregate", a: []BalanceHistory{ - BalanceHistory{ + { ReceivedSat: (*Amount)(big.NewInt(1)), SentSat: (*Amount)(big.NewInt(2)), Time: 1521504812, Txid: "0011223344556677889900112233445566778899001122334455667788990011", Txs: 1, }, - BalanceHistory{ + { ReceivedSat: (*Amount)(big.NewInt(3)), SentSat: (*Amount)(big.NewInt(4)), Time: 1521504812, Txid: "00b2c06055e5e90e9c82bd4181fde310104391a7fa4f289b1704e5d90caa3840", Txs: 1, }, - BalanceHistory{ + { ReceivedSat: (*Amount)(big.NewInt(5)), SentSat: (*Amount)(big.NewInt(6)), Time: 1521514812, Txid: "00b2c06055e5e90e9c82bd4181fde310104391a7fa4f289b1704e5d90caa3840", Txs: 1, }, - BalanceHistory{ + { ReceivedSat: (*Amount)(big.NewInt(7)), SentSat: (*Amount)(big.NewInt(8)), Time: 1521504812, Txid: "00b2c06055e5e90e9c82bd4181fde310104391a7fa4f289b1704e5d90caa3840", Txs: 1, }, - BalanceHistory{ + { ReceivedSat: (*Amount)(big.NewInt(9)), SentSat: (*Amount)(big.NewInt(10)), Time: 1521534812, Txid: "0011223344556677889900112233445566778899001122334455667788990011", Txs: 1, }, - BalanceHistory{ + { ReceivedSat: (*Amount)(big.NewInt(11)), SentSat: (*Amount)(big.NewInt(12)), Time: 1521534812, @@ -132,19 +132,19 @@ func TestBalanceHistories_SortAndAggregate(t *testing.T) { }, groupByTime: 3600, want: []BalanceHistory{ - BalanceHistory{ + { ReceivedSat: (*Amount)(big.NewInt(11)), SentSat: (*Amount)(big.NewInt(14)), Time: 1521504000, Txs: 2, }, - BalanceHistory{ + { ReceivedSat: (*Amount)(big.NewInt(5)), SentSat: (*Amount)(big.NewInt(6)), Time: 1521514800, Txs: 1, }, - BalanceHistory{ + { ReceivedSat: (*Amount)(big.NewInt(20)), SentSat: (*Amount)(big.NewInt(22)), Time: 1521532800, diff --git a/api/worker.go b/api/worker.go index b66203ac..83a6ecf4 100644 --- a/api/worker.go +++ b/api/worker.go @@ -1149,7 +1149,7 @@ func (w *Worker) GetFiatRatesForBlockID(bid string, currency string) (*db.Result if currency == "" { return nil, NewAPIError("Missing or empty \"currency\" parameter", true) } - ticker := &db.CurrencyRatesTicker{} + var ticker *db.CurrencyRatesTicker bi, err := w.getBlockInfoFromBlockID(bid) if err != nil { if err == bchain.ErrBlockNotFound {