Linter fixes (#246)

Linter fixes
This commit is contained in:
Adrian Gallagher
2019-02-05 16:26:04 +11:00
committed by GitHub
parent d7368c1a8d
commit 5e5ca8a887
85 changed files with 641 additions and 794 deletions

View File

@@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"net/http"
"net/url"
"reflect"
"strconv"
@@ -634,7 +635,7 @@ func (b *Bitstamp) TransferAccountBalance(amount float64, currency, subAccount s
// SendHTTPRequest sends an unauthenticated HTTP request
func (b *Bitstamp) SendHTTPRequest(path string, result interface{}) error {
return b.SendPayload("GET", path, nil, nil, result, false, b.Verbose)
return b.SendPayload(http.MethodGet, path, nil, nil, result, false, b.Verbose)
}
// SendAuthenticatedHTTPRequest sends an authenticated request
@@ -680,7 +681,7 @@ func (b *Bitstamp) SendAuthenticatedHTTPRequest(path string, v2 bool, values url
Error string `json:"error"`
}{}
err := b.SendPayload("POST", path, headers, readerValues, &interim, true, b.Verbose)
err := b.SendPayload(http.MethodPost, path, headers, readerValues, &interim, true, b.Verbose)
if err != nil {
return err
}

View File

@@ -8,7 +8,7 @@ import (
"github.com/thrasher-/gocryptotrader/config"
"github.com/thrasher-/gocryptotrader/currency/pair"
"github.com/thrasher-/gocryptotrader/currency/symbol"
"github.com/thrasher-/gocryptotrader/exchanges"
exchange "github.com/thrasher-/gocryptotrader/exchanges"
)
// Please add your private keys and customerID for better tests
@@ -27,13 +27,13 @@ func TestSetDefaults(t *testing.T) {
if b.Name != "Bitstamp" {
t.Error("Test Failed - SetDefaults() error")
}
if b.Enabled != false {
if b.Enabled {
t.Error("Test Failed - SetDefaults() error")
}
if b.Verbose != false {
if b.Verbose {
t.Error("Test Failed - SetDefaults() error")
}
if b.Websocket.IsEnabled() != false {
if b.Websocket.IsEnabled() {
t.Error("Test Failed - SetDefaults() error")
}
if b.RESTPollingDelay != 10 {
@@ -268,7 +268,7 @@ func TestCancelExistingOrder(t *testing.T) {
t.Parallel()
resp, err := b.CancelExistingOrder(1337)
if err == nil || resp != false {
if err == nil || resp {
t.Error("Test Failed - CancelExistingOrder() error")
}
}

View File

@@ -176,7 +176,7 @@ func (b *Bitstamp) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]
}
// SubmitOrder submits a new order
func (b *Bitstamp) SubmitOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (exchange.SubmitOrderResponse, error) {
func (b *Bitstamp) SubmitOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, _ string) (exchange.SubmitOrderResponse, error) {
var submitOrderResponse exchange.SubmitOrderResponse
buy := side == exchange.BuyOrderSide
market := orderType == exchange.MarketOrderType
@@ -212,7 +212,7 @@ func (b *Bitstamp) CancelOrder(order exchange.OrderCancellation) error {
}
// CancelAllOrders cancels all orders associated with a currency pair
func (b *Bitstamp) CancelAllOrders(orderCancellation exchange.OrderCancellation) (exchange.CancelAllOrdersResponse, error) {
func (b *Bitstamp) CancelAllOrders(_ exchange.OrderCancellation) (exchange.CancelAllOrdersResponse, error) {
isCancelAllSuccessful, err := b.CancelAllExistingOrders()
if !isCancelAllSuccessful {
err = errors.New("Cancel all failed. Bitstamp provides no further information. Check order status to verify")
@@ -228,7 +228,7 @@ func (b *Bitstamp) GetOrderInfo(orderID int64) (exchange.OrderDetail, error) {
}
// GetDepositAddress returns a deposit address for a specified currency
func (b *Bitstamp) GetDepositAddress(cryptocurrency pair.CurrencyItem, accountID string) (string, error) {
func (b *Bitstamp) GetDepositAddress(cryptocurrency pair.CurrencyItem, _ string) (string, error) {
return b.GetCryptoDepositAddress(cryptocurrency.String())
}