mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Fix GoReport issues
This commit is contained in:
@@ -19,7 +19,7 @@ func TestSupportsPair(t *testing.T) {
|
||||
_, err = cfg.SupportsPair("asdf", pair.NewCurrencyPair("BTC", "USD"))
|
||||
if err == nil {
|
||||
t.Error(
|
||||
"Test failed. TestSupportsPair. Non-existant exchange returned nil error",
|
||||
"Test failed. TestSupportsPair. Non-existent exchange returned nil error",
|
||||
)
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ func TestGetAvailablePairs(t *testing.T) {
|
||||
_, err = cfg.GetAvailablePairs("asdf")
|
||||
if err == nil {
|
||||
t.Error(
|
||||
"Test failed. TestGetAvailablePairs. Non-existant exchange returned nil error",
|
||||
"Test failed. TestGetAvailablePairs. Non-existent exchange returned nil error",
|
||||
)
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ func TestGetEnabledPairs(t *testing.T) {
|
||||
_, err = cfg.GetEnabledPairs("asdf")
|
||||
if err == nil {
|
||||
t.Error(
|
||||
"Test failed. TestGetEnabledPairs. Non-existant exchange returned nil error",
|
||||
"Test failed. TestGetEnabledPairs. Non-existent exchange returned nil error",
|
||||
)
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ func TestGetConfigCurrencyPairFormat(t *testing.T) {
|
||||
_, err = cfg.GetConfigCurrencyPairFormat("asdasdasd")
|
||||
if err == nil {
|
||||
t.Errorf(
|
||||
"Test failed. TestGetRequestCurrencyPairFormat. Non-existant exchange returned nil error",
|
||||
"Test failed. TestGetRequestCurrencyPairFormat. Non-existent exchange returned nil error",
|
||||
)
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ func TestGetRequestCurrencyPairFormat(t *testing.T) {
|
||||
_, err = cfg.GetRequestCurrencyPairFormat("asdasdasd")
|
||||
if err == nil {
|
||||
t.Errorf(
|
||||
"Test failed. TestGetRequestCurrencyPairFormat. Non-existant exchange returned nil error",
|
||||
"Test failed. TestGetRequestCurrencyPairFormat. Non-existent exchange returned nil error",
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ func TestContains(t *testing.T) {
|
||||
}
|
||||
|
||||
if Contains(pairs, NewCurrencyPair("ETH", "USD"), false) {
|
||||
t.Errorf("Test failed. TestContains: Non-existant pair was found")
|
||||
t.Errorf("Test failed. TestContains: Non-existent pair was found")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ func TestContainsCurrency(t *testing.T) {
|
||||
}
|
||||
|
||||
if ContainsCurrency(p, "ETH") {
|
||||
t.Error("Test failed. TestContainsCurrency: Non-existant currency was found")
|
||||
t.Error("Test failed. TestContainsCurrency: Non-existent currency was found")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ func TestCheckExchangeExists(t *testing.T) {
|
||||
}
|
||||
|
||||
if CheckExchangeExists("Asdsad") {
|
||||
t.Errorf("Test failed. TestGetExchangeExists: Non-existant exchange found")
|
||||
t.Errorf("Test failed. TestGetExchangeExists: Non-existent exchange found")
|
||||
}
|
||||
|
||||
CleanupTest(t)
|
||||
@@ -77,7 +77,7 @@ func TestGetExchangeByName(t *testing.T) {
|
||||
|
||||
exch = GetExchangeByName("Asdasd")
|
||||
if exch != nil {
|
||||
t.Errorf("Test failed. TestGetExchangeByName: Non-existant exchange found")
|
||||
t.Errorf("Test failed. TestGetExchangeByName: Non-existent exchange found")
|
||||
}
|
||||
|
||||
CleanupTest(t)
|
||||
|
||||
@@ -217,27 +217,27 @@ func (a *Alphapoint) SetUserInfo(firstName, lastName, cell2FACountryCode, cell2F
|
||||
response := UserInfoSet{}
|
||||
|
||||
var userInfoKVPs = []UserInfoKVP{
|
||||
UserInfoKVP{
|
||||
{
|
||||
Key: "FirstName",
|
||||
Value: firstName,
|
||||
},
|
||||
UserInfoKVP{
|
||||
{
|
||||
Key: "LastName",
|
||||
Value: lastName,
|
||||
},
|
||||
UserInfoKVP{
|
||||
{
|
||||
Key: "Cell2FACountryCode",
|
||||
Value: cell2FACountryCode,
|
||||
},
|
||||
UserInfoKVP{
|
||||
{
|
||||
Key: "Cell2FAValue",
|
||||
Value: cell2FAValue,
|
||||
},
|
||||
UserInfoKVP{
|
||||
{
|
||||
Key: "UseAuthy2FA",
|
||||
Value: strconv.FormatBool(useAuthy2FA),
|
||||
},
|
||||
UserInfoKVP{
|
||||
{
|
||||
Key: "Use2FAForWithdraw",
|
||||
Value: strconv.FormatBool(use2FAForWithdraw),
|
||||
},
|
||||
|
||||
@@ -337,7 +337,7 @@ func (b *Bitfinex) GetTrades(currencyPair string, values url.Values) ([]TradeStr
|
||||
return response, common.SendHTTPGetRequest(path, true, b.Verbose, &response)
|
||||
}
|
||||
|
||||
// GetTradesV2 uses the V2 API to get historic trades that occured on the
|
||||
// GetTradesV2 uses the V2 API to get historic trades that occurred on the
|
||||
// exchange
|
||||
//
|
||||
// currencyPair e.g. "tBTCUSD" v2 prefixes currency pairs with t. (?)
|
||||
|
||||
@@ -262,7 +262,7 @@ func TestGetOrderHistory(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetWithdrawelHistory(t *testing.T) {
|
||||
func TestGetwithdrawalHistory(t *testing.T) {
|
||||
t.Parallel()
|
||||
obj := Bittrex{}
|
||||
obj.APIKey = apiKey
|
||||
|
||||
@@ -102,7 +102,7 @@ type OrderResponse struct {
|
||||
Side string `json:"side"`
|
||||
}
|
||||
|
||||
// Commission holds trade commision structure
|
||||
// Commission holds trade commission structure
|
||||
type Commission struct {
|
||||
Currency string `json:"currency"`
|
||||
Amount float64 `json:"amount,string"`
|
||||
|
||||
@@ -498,7 +498,7 @@ func TestSetCurrencies(t *testing.T) {
|
||||
|
||||
err = UAC.SetCurrencies([]pair.CurrencyPair{newPair}, true)
|
||||
if err == nil {
|
||||
t.Fatal("Test failed. TestSetCurrencies returned nil error on non-existant exchange")
|
||||
t.Fatal("Test failed. TestSetCurrencies returned nil error on non-existent exchange")
|
||||
}
|
||||
|
||||
UAC.Name = "ANX"
|
||||
|
||||
@@ -44,7 +44,7 @@ type PairSettings struct {
|
||||
MinAmount float64 `json:"min_amount,string"`
|
||||
}
|
||||
|
||||
// AuthResponse stores the auth reponse
|
||||
// AuthResponse stores the auth response
|
||||
type AuthResponse struct {
|
||||
Result bool `json:"bool"`
|
||||
Error string `json:"error"`
|
||||
|
||||
@@ -129,7 +129,7 @@ func (p *HitBTC) GetSymbols(symbol string) ([]string, error) {
|
||||
}
|
||||
|
||||
// GetSymbolsDetailed is the same as above but returns an array of symbols with
|
||||
// all ther details.
|
||||
// all their details.
|
||||
func (p *HitBTC) GetSymbolsDetailed() ([]Symbol, error) {
|
||||
resp := []Symbol{}
|
||||
path := fmt.Sprintf("%s/%s", apiURL, apiV2Symbol)
|
||||
|
||||
@@ -212,7 +212,7 @@ type MoveOrderResponse struct {
|
||||
Trades map[string][]ResultingTrades `json:"resultingTrades"`
|
||||
}
|
||||
|
||||
// Withdraw holds response for a withdrawel process
|
||||
// Withdraw holds response for a withdrawal process
|
||||
type Withdraw struct {
|
||||
Response string `json:"response"`
|
||||
Error string `json:"error"`
|
||||
|
||||
@@ -64,7 +64,7 @@ type Detail struct {
|
||||
Open float64 `json:"open"`
|
||||
Close float64 `json:"close"`
|
||||
High float64 `json:"high"`
|
||||
Timestamp int64 `json:"id"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
ID int `json:"id"`
|
||||
Count int `json:"count"`
|
||||
Low float64 `json:"low"`
|
||||
|
||||
@@ -175,9 +175,9 @@ func (l *LocalBitcoins) GetAccountInfo(username string, self bool) (AccountInfo,
|
||||
}
|
||||
|
||||
// Getads returns information of single advertisement based on the ad ID, if
|
||||
// adID ommited.
|
||||
// adID omitted.
|
||||
//
|
||||
// adID - [optional] string if ommited returns all ads
|
||||
// adID - [optional] string if omitted returns all ads
|
||||
func (l *LocalBitcoins) Getads(adID string) (AdData, error) {
|
||||
type response struct {
|
||||
Data AdData `json:"data"`
|
||||
|
||||
@@ -882,7 +882,7 @@ func (o *OKCoin) CancelFuturesOrder(orderID int64, symbol, contractType string)
|
||||
}
|
||||
}
|
||||
|
||||
// GetFuturesOrderInfo returns information on a specfic futures contract order
|
||||
// GetFuturesOrderInfo returns information on a specific futures contract order
|
||||
func (o *OKCoin) GetFuturesOrderInfo(orderID, status, currentPage, pageLength int64, symbol, contractType string) {
|
||||
v := url.Values{}
|
||||
v.Set("symbol", symbol)
|
||||
|
||||
@@ -13,7 +13,7 @@ func TestCalculateTotalBids(t *testing.T) {
|
||||
base := Base{
|
||||
Pair: currency,
|
||||
CurrencyPair: currency.Pair().String(),
|
||||
Bids: []Item{Item{Price: 100, Amount: 10}},
|
||||
Bids: []Item{{Price: 100, Amount: 10}},
|
||||
LastUpdated: time.Now(),
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ func TestCalculateTotaAsks(t *testing.T) {
|
||||
base := Base{
|
||||
Pair: currency,
|
||||
CurrencyPair: currency.Pair().String(),
|
||||
Asks: []Item{Item{Price: 100, Amount: 10}},
|
||||
Asks: []Item{{Price: 100, Amount: 10}},
|
||||
LastUpdated: time.Now(),
|
||||
}
|
||||
|
||||
@@ -46,13 +46,13 @@ func TestUpdate(t *testing.T) {
|
||||
base := Base{
|
||||
Pair: currency,
|
||||
CurrencyPair: currency.Pair().String(),
|
||||
Asks: []Item{Item{Price: 100, Amount: 10}},
|
||||
Bids: []Item{Item{Price: 200, Amount: 10}},
|
||||
Asks: []Item{{Price: 100, Amount: 10}},
|
||||
Bids: []Item{{Price: 200, Amount: 10}},
|
||||
LastUpdated: timeNow,
|
||||
}
|
||||
|
||||
asks := []Item{Item{Price: 200, Amount: 101}}
|
||||
bids := []Item{Item{Price: 201, Amount: 100}}
|
||||
asks := []Item{{Price: 200, Amount: 101}}
|
||||
bids := []Item{{Price: 201, Amount: 100}}
|
||||
time.Sleep(time.Millisecond * 50)
|
||||
base.Update(bids, asks)
|
||||
|
||||
@@ -76,8 +76,8 @@ func TestGetOrderbook(t *testing.T) {
|
||||
base := Base{
|
||||
Pair: currency,
|
||||
CurrencyPair: currency.Pair().String(),
|
||||
Asks: []Item{Item{Price: 100, Amount: 10}},
|
||||
Bids: []Item{Item{Price: 200, Amount: 10}},
|
||||
Asks: []Item{{Price: 100, Amount: 10}},
|
||||
Bids: []Item{{Price: 200, Amount: 10}},
|
||||
}
|
||||
|
||||
CreateNewOrderbook("Exchange", currency, base, Spot)
|
||||
@@ -115,8 +115,8 @@ func TestGetOrderbookByExchange(t *testing.T) {
|
||||
base := Base{
|
||||
Pair: currency,
|
||||
CurrencyPair: currency.Pair().String(),
|
||||
Asks: []Item{Item{Price: 100, Amount: 10}},
|
||||
Bids: []Item{Item{Price: 200, Amount: 10}},
|
||||
Asks: []Item{{Price: 100, Amount: 10}},
|
||||
Bids: []Item{{Price: 200, Amount: 10}},
|
||||
}
|
||||
|
||||
CreateNewOrderbook("Exchange", currency, base, Spot)
|
||||
@@ -127,9 +127,9 @@ func TestGetOrderbookByExchange(t *testing.T) {
|
||||
err)
|
||||
}
|
||||
|
||||
_, err = GetOrderbookByExchange("nonexistant")
|
||||
_, err = GetOrderbookByExchange("nonexistent")
|
||||
if err == nil {
|
||||
t.Fatal("Test failed. TestGetOrderbookByExchange retrieved non-existant orderbook")
|
||||
t.Fatal("Test failed. TestGetOrderbookByExchange retrieved non-existent orderbook")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,8 +138,8 @@ func TestFirstCurrencyExists(t *testing.T) {
|
||||
base := Base{
|
||||
Pair: currency,
|
||||
CurrencyPair: currency.Pair().String(),
|
||||
Asks: []Item{Item{Price: 100, Amount: 10}},
|
||||
Bids: []Item{Item{Price: 200, Amount: 10}},
|
||||
Asks: []Item{{Price: 100, Amount: 10}},
|
||||
Bids: []Item{{Price: 200, Amount: 10}},
|
||||
}
|
||||
|
||||
CreateNewOrderbook("Exchange", currency, base, Spot)
|
||||
@@ -159,8 +159,8 @@ func TestSecondCurrencyExists(t *testing.T) {
|
||||
base := Base{
|
||||
Pair: currency,
|
||||
CurrencyPair: currency.Pair().String(),
|
||||
Asks: []Item{Item{Price: 100, Amount: 10}},
|
||||
Bids: []Item{Item{Price: 200, Amount: 10}},
|
||||
Asks: []Item{{Price: 100, Amount: 10}},
|
||||
Bids: []Item{{Price: 200, Amount: 10}},
|
||||
}
|
||||
|
||||
CreateNewOrderbook("Exchange", currency, base, Spot)
|
||||
@@ -180,8 +180,8 @@ func TestCreateNewOrderbook(t *testing.T) {
|
||||
base := Base{
|
||||
Pair: currency,
|
||||
CurrencyPair: currency.Pair().String(),
|
||||
Asks: []Item{Item{Price: 100, Amount: 10}},
|
||||
Bids: []Item{Item{Price: 200, Amount: 10}},
|
||||
Asks: []Item{{Price: 100, Amount: 10}},
|
||||
Bids: []Item{{Price: 200, Amount: 10}},
|
||||
}
|
||||
|
||||
CreateNewOrderbook("Exchange", currency, base, Spot)
|
||||
@@ -212,8 +212,8 @@ func TestProcessOrderbook(t *testing.T) {
|
||||
base := Base{
|
||||
Pair: currency,
|
||||
CurrencyPair: currency.Pair().String(),
|
||||
Asks: []Item{Item{Price: 100, Amount: 10}},
|
||||
Bids: []Item{Item{Price: 200, Amount: 10}},
|
||||
Asks: []Item{{Price: 100, Amount: 10}},
|
||||
Bids: []Item{{Price: 200, Amount: 10}},
|
||||
}
|
||||
|
||||
ProcessOrderbook("Exchange", currency, base, Spot)
|
||||
@@ -240,7 +240,7 @@ func TestProcessOrderbook(t *testing.T) {
|
||||
t.Fatal("Test failed. TestProcessOrderbook result pair is incorrect")
|
||||
}
|
||||
|
||||
base.Asks = []Item{Item{Price: 200, Amount: 200}}
|
||||
base.Asks = []Item{{Price: 200, Amount: 200}}
|
||||
ProcessOrderbook("Exchange", currency, base, "monthly")
|
||||
|
||||
result, err = GetOrderbook("Exchange", currency, "monthly")
|
||||
@@ -253,7 +253,7 @@ func TestProcessOrderbook(t *testing.T) {
|
||||
t.Fatal("Test failed. TestProcessOrderbook CalculateTotalsAsks incorrect values")
|
||||
}
|
||||
|
||||
base.Bids = []Item{Item{Price: 420, Amount: 200}}
|
||||
base.Bids = []Item{{Price: 420, Amount: 200}}
|
||||
ProcessOrderbook("Blah", currency, base, "quarterly")
|
||||
result, err = GetOrderbook("Blah", currency, "quarterly")
|
||||
if err != nil {
|
||||
|
||||
@@ -19,7 +19,7 @@ func TestGetEthereumBalance(t *testing.T) {
|
||||
}
|
||||
|
||||
response, err = GetEthereumBalance(nonsenseAddress)
|
||||
if response.Error.Message != "" {
|
||||
if response.Error.Message != "" || err == nil {
|
||||
t.Errorf("Test Failed - Portfolio GetEthereumBalance() Error: %s",
|
||||
response.Error.Message)
|
||||
}
|
||||
|
||||
@@ -103,8 +103,7 @@ func main() {
|
||||
GoCryptoTrader: Exchange documentation tool
|
||||
|
||||
This will update and regenerate documentation for the different packages
|
||||
in GoCryptoTrader.
|
||||
`)
|
||||
in GoCryptoTrader.`)
|
||||
|
||||
codebasePaths = make(map[string]string)
|
||||
codebaseTemplatePath = make(map[string]string)
|
||||
|
||||
Reference in New Issue
Block a user