diff --git a/currency/currency_test.go b/currency/currency_test.go index bee21e73..339c9c9a 100644 --- a/currency/currency_test.go +++ b/currency/currency_test.go @@ -409,26 +409,26 @@ func TestConvertCurrency(t *testing.T) { t.Errorf("Test failed. ConvertCurrency USD -> AUD. Error %s", err) } - // Test non-existant currencies + // Test non-existent currencies _, err = ConvertCurrency(1000, "ASDF", "USD") if err == nil { - t.Errorf("Test failed. ConvertCurrency non-existant currency -> USD. Error %s", err) + t.Errorf("Test failed. ConvertCurrency non-existent currency -> USD. Error %s", err) } _, err = ConvertCurrency(1000, "USD", "ASDF") if err == nil { - t.Errorf("Test failed. ConvertCurrency USD -> non-existant currency. Error %s", err) + t.Errorf("Test failed. ConvertCurrency USD -> non-existent currency. Error %s", err) } _, err = ConvertCurrency(1000, "CNY", "UAHF") if err == nil { - t.Errorf("Test failed. ConvertCurrency non-USD currency CNY -> non-existant currency. Error %s", err) + t.Errorf("Test failed. ConvertCurrency non-USD currency CNY -> non-existent currency. Error %s", err) } _, err = ConvertCurrency(1000, "UASF", "UAHF") if err == nil { - t.Errorf("Test failed. ConvertCurrency non-existant currency -> non-existant currency. Error %s", err) + t.Errorf("Test failed. ConvertCurrency non-existent currency -> non-existent currency. Error %s", err) } } diff --git a/currency/symbol/symbol_test.go b/currency/symbol/symbol_test.go index 5975cb67..5c026c9c 100644 --- a/currency/symbol/symbol_test.go +++ b/currency/symbol/symbol_test.go @@ -15,7 +15,7 @@ func TestGetSymbolByCurrencyName(t *testing.T) { _, err = GetSymbolByCurrencyName("BLAH") if err == nil { - t.Errorf("Test failed. TestGetSymbolByCurrencyNam returned nil on non-existant currency") + t.Errorf("Test failed. TestGetSymbolByCurrencyNam returned nil on non-existent currency") } } diff --git a/exchanges/alphapoint/alphapoint_types.go b/exchanges/alphapoint/alphapoint_types.go index 549b48c4..f00cedf2 100644 --- a/exchanges/alphapoint/alphapoint_types.go +++ b/exchanges/alphapoint/alphapoint_types.go @@ -43,7 +43,7 @@ type Trades struct { Trades []Trade `json:"trades"` } -// Trade is a sub-type which holds the singular trade that occured in the past +// Trade is a sub-type which holds the singular trade that occurred in the past type Trade struct { TID int64 `json:"tid"` Price float64 `json:"px"` diff --git a/exchanges/bitfinex/bitfinex.go b/exchanges/bitfinex/bitfinex.go index b25ad80f..6be03af7 100644 --- a/exchanges/bitfinex/bitfinex.go +++ b/exchanges/bitfinex/bitfinex.go @@ -188,7 +188,7 @@ func (b *Bitfinex) GetLends(symbol string, values url.Values) ([]Lends, error) { return response, common.SendHTTPGetRequest(path, true, b.Verbose, &response) } -// GetSymbols returns the avaliable currency pairs on the exchange +// GetSymbols returns the available currency pairs on the exchange func (b *Bitfinex) GetSymbols() ([]string, error) { products := []string{} path := fmt.Sprint(bitfinexAPIURL + bitfinexSymbols) @@ -444,7 +444,7 @@ func (b *Bitfinex) GetBalanceHistory(symbol string, timeSince, timeUntil time.Ti b.SendAuthenticatedHTTPRequest("POST", bitfinexHistory, request, &response) } -// GetMovementHistory returns an array of past deposits and withdrawels +// GetMovementHistory returns an array of past deposits and withdrawals func (b *Bitfinex) GetMovementHistory(symbol, method string, timeSince, timeUntil time.Time, limit int) ([]MovementHistory, error) { response := []MovementHistory{} request := make(map[string]interface{}) diff --git a/exchanges/bitfinex/bitfinex_types.go b/exchanges/bitfinex/bitfinex_types.go index 976c6b02..fbd532cb 100644 --- a/exchanges/bitfinex/bitfinex_types.go +++ b/exchanges/bitfinex/bitfinex_types.go @@ -40,7 +40,7 @@ type TradeStructure struct { Type string `json:"sell"` } -// Lendbook holds most recent funding data for a relevent currency +// Lendbook holds most recent funding data for a relevant currency type Lendbook struct { Bids []Book `json:"bids"` Asks []Book `json:"asks"` @@ -86,7 +86,7 @@ type AccountInfo struct { } `json:"fees"` } -// AccountFees stores withdrawel account fee data from Bitfinex +// AccountFees stores withdrawal account fee data from Bitfinex type AccountFees struct { Withdraw struct { BTC float64 `json:"BTC,string"` @@ -186,7 +186,7 @@ type WalletTransfer struct { Message string `json:"message"` } -// Withdrawal holds withdrawel status information +// Withdrawal holds withdrawal status information type Withdrawal struct { Status string `json:"status"` Message string `json:"message"` @@ -300,7 +300,7 @@ type Offer struct { ExecutedAmount float64 `json:"executed_amount,string"` } -// MarginFunds holds active funding information used in a margin positon +// MarginFunds holds active funding information used in a margin position type MarginFunds struct { ID int64 `json:"id"` PositionID int64 `json:"position_id"` diff --git a/exchanges/bitstamp/bitstamp.go b/exchanges/bitstamp/bitstamp.go index fa385413..e391ec53 100644 --- a/exchanges/bitstamp/bitstamp.go +++ b/exchanges/bitstamp/bitstamp.go @@ -350,7 +350,7 @@ func (b *Bitstamp) PlaceOrder(currencyPair string, price float64, amount float64 b.SendAuthenticatedHTTPRequest(path, true, req, &response) } -// GetWithdrawalRequests returns withdrawl requests for the account +// GetWithdrawalRequests returns withdrawal requests for the account // timedelta - positive integer with max value 50000000 which returns requests // from number of seconds ago to now. func (b *Bitstamp) GetWithdrawalRequests(timedelta int64) ([]WithdrawalRequests, error) { diff --git a/exchanges/btcmarkets/btcmarkets.go b/exchanges/btcmarkets/btcmarkets.go index 1f6bc8e8..304852ce 100644 --- a/exchanges/btcmarkets/btcmarkets.go +++ b/exchanges/btcmarkets/btcmarkets.go @@ -60,7 +60,7 @@ func (b *BTCMarkets) SetDefaults() { b.AssetTypes = []string{ticker.Spot} } -// Setup takes in an exchange configuration and sets all paramaters +// Setup takes in an exchange configuration and sets all parameters func (b *BTCMarkets) Setup(exch config.ExchangeConfig) { if !exch.Enabled { b.SetEnabled(false) diff --git a/exchanges/exchange.go b/exchanges/exchange.go index f66e382b..95a706ee 100644 --- a/exchanges/exchange.go +++ b/exchanges/exchange.go @@ -15,7 +15,7 @@ import ( const ( warningBase64DecryptSecretKeyFailed = "WARNING -- Exchange %s unable to base64 decode secret key.. Disabling Authenticated API support." - // WarningAuthenticatedRequestWithoutCredentialsSet error message for authenticated request without credentails set + // WarningAuthenticatedRequestWithoutCredentialsSet error message for authenticated request without credentials set WarningAuthenticatedRequestWithoutCredentialsSet = "WARNING -- Exchange %s authenticated HTTP request called but not supported due to unset/default API keys." // ErrExchangeNotFound is a constant for an error message ErrExchangeNotFound = "Exchange not found in dataset." diff --git a/exchanges/exchange_test.go b/exchanges/exchange_test.go index 1a553bfb..39c97f72 100644 --- a/exchanges/exchange_test.go +++ b/exchanges/exchange_test.go @@ -22,7 +22,7 @@ func TestSetAssetTypes(t *testing.T) { err = b.SetAssetTypes() if err == nil { - t.Fatal("Test failed. TestSetAssetTypes returned nil error for a non-existant exchange") + t.Fatal("Test failed. TestSetAssetTypes returned nil error for a non-existent exchange") } b.Name = "ANX" @@ -77,9 +77,9 @@ func TestGetExchangeAssetTypes(t *testing.T) { t.Fatal("Test failed. Bitfinex does not contain default asset type 'SPOT'") } - _, err = GetExchangeAssetTypes("non-existant-exchange") + _, err = GetExchangeAssetTypes("non-existent-exchange") if err == nil { - t.Fatal("Test failed. Got asset types for non-existant exchange") + t.Fatal("Test failed. Got asset types for non-existent exchange") } } @@ -96,7 +96,7 @@ func TestSetCurrencyPairFormat(t *testing.T) { err = b.SetCurrencyPairFormat() if err == nil { - t.Fatal("Test failed. TestSetCurrencyPairFormat returned nil error for a non-existant exchange") + t.Fatal("Test failed. TestSetCurrencyPairFormat returned nil error for a non-existent exchange") } b.Name = "ANX" @@ -349,9 +349,9 @@ func TestGetAndFormatExchangeCurrencies(t *testing.T) { actual, expected) } - _, err = GetAndFormatExchangeCurrencies("non-existant", pairs) + _, err = GetAndFormatExchangeCurrencies("non-existent", pairs) if err == nil { - t.Errorf("Test failed - Exchange TestGetAndFormatExchangeCurrencies returned nil error on non-existant exchange") + t.Errorf("Test failed - Exchange TestGetAndFormatExchangeCurrencies returned nil error on non-existent exchange") } } diff --git a/exchanges/gdax/gdax.go b/exchanges/gdax/gdax.go index 0749ade9..bbf7cc33 100644 --- a/exchanges/gdax/gdax.go +++ b/exchanges/gdax/gdax.go @@ -71,7 +71,7 @@ func (g *GDAX) SetDefaults() { g.AssetTypes = []string{ticker.Spot} } -// Setup initialises the exchange paramaters with the current configuration +// Setup initialises the exchange parameters with the current configuration func (g *GDAX) Setup(exch config.ExchangeConfig) { if !exch.Enabled { g.SetEnabled(false) @@ -514,7 +514,7 @@ func (g *GDAX) GetFills(orderID, currencyPair string) ([]FillResponse, error) { params.Set("product_id", currencyPair) } if len(params.Get("order_id")) == 0 && len(params.Get("product_id")) == 0 { - return resp, errors.New("no paramaters set") + return resp, errors.New("no parameters set") } path := common.EncodeURLValues(gdaxAPIURL+gdaxFills, params) @@ -708,7 +708,7 @@ func (g *GDAX) GetCoinbaseAccounts() ([]CoinbaseAccounts, error) { // E.g. BTC-USD. *Required* if type is fills // accountID - ID of the account to generate an account report for. *Required* // if type is account -// format - pdf or csv (defualt is pdf) +// format - pdf or csv (default is pdf) // email - [optional] Email address to send the report to func (g *GDAX) GetReport(reportType, startDate, endDate, currencyPair, accountID, format, email string) (Report, error) { resp := Report{} diff --git a/exchanges/gemini/gemini.go b/exchanges/gemini/gemini.go index 33c54dc6..e21844f4 100644 --- a/exchanges/gemini/gemini.go +++ b/exchanges/gemini/gemini.go @@ -111,7 +111,7 @@ func (g *Gemini) SetDefaults() { g.AssetTypes = []string{ticker.Spot} } -// Setup sets exchange configuration paramaters +// Setup sets exchange configuration parameters func (g *Gemini) Setup(exch config.ExchangeConfig) { if !exch.Enabled { g.SetEnabled(false) @@ -204,7 +204,7 @@ func (g *Gemini) GetTrades(currencyPair string, params url.Values) ([]Trade, err return trades, common.SendHTTPGetRequest(path, true, g.Verbose, &trades) } -// GetAuction returns auction infomation +// GetAuction returns auction information func (g *Gemini) GetAuction(currencyPair string) (Auction, error) { path := fmt.Sprintf("%s/v%s/%s/%s", geminiAPIURL, geminiAPIVersion, geminiAuction, currencyPair) auction := Auction{} @@ -348,8 +348,8 @@ func (g *Gemini) GetDepositAddress(depositAddlabel, currency string) (DepositAdd } // WithdrawCrypto withdraws crypto currency to a whitelisted address -func (g *Gemini) WithdrawCrypto(address, currency string, amount float64) (WithdrawelAddress, error) { - response := WithdrawelAddress{} +func (g *Gemini) WithdrawCrypto(address, currency string, amount float64) (WithdrawalAddress, error) { + response := WithdrawalAddress{} request := make(map[string]interface{}) request["address"] = address request["amount"] = strconv.FormatFloat(amount, 'f', -1, 64) diff --git a/exchanges/gemini/gemini_types.go b/exchanges/gemini/gemini_types.go index a6cd4aed..dfa5c64b 100644 --- a/exchanges/gemini/gemini_types.go +++ b/exchanges/gemini/gemini_types.go @@ -150,8 +150,8 @@ type DepositAddress struct { Label string `json:"label"` } -// WithdrawelAddress holds withdrawel information -type WithdrawelAddress struct { +// WithdrawalAddress holds withdrawal information +type WithdrawalAddress struct { Address string `json:"address"` Amount float64 `json:"amount"` TXHash string `json:"txHash"` diff --git a/exchanges/itbit/itbit.go b/exchanges/itbit/itbit.go index 49fc986a..7efc3d11 100644 --- a/exchanges/itbit/itbit.go +++ b/exchanges/itbit/itbit.go @@ -51,7 +51,7 @@ func (i *ItBit) SetDefaults() { i.AssetTypes = []string{ticker.Spot} } -// Setup sets the exchange paramaters from exchange config +// Setup sets the exchange parameters from exchange config func (i *ItBit) Setup(exch config.ExchangeConfig) { if !exch.Enabled { i.SetEnabled(false) diff --git a/exchanges/orderbook/orderbook_test.go b/exchanges/orderbook/orderbook_test.go index d03e4c26..e0ce2f22 100644 --- a/exchanges/orderbook/orderbook_test.go +++ b/exchanges/orderbook/orderbook_test.go @@ -92,21 +92,21 @@ func TestGetOrderbook(t *testing.T) { t.Fatal("Test failed. TestGetOrderbook failed. Mismatched pairs") } - _, err = GetOrderbook("nonexistant", currency, Spot) + _, err = GetOrderbook("nonexistent", currency, Spot) if err == nil { - t.Fatal("Test failed. TestGetOrderbook retrieved non-existant orderbook") + t.Fatal("Test failed. TestGetOrderbook retrieved non-existent orderbook") } currency.FirstCurrency = "blah" _, err = GetOrderbook("Exchange", currency, Spot) if err == nil { - t.Fatal("Test failed. TestGetOrderbook retrieved non-existant orderbook using invalid first currency") + t.Fatal("Test failed. TestGetOrderbook retrieved non-existent orderbook using invalid first currency") } newCurrency := pair.NewCurrencyPair("BTC", "AUD") _, err = GetOrderbook("Exchange", newCurrency, Spot) if err == nil { - t.Fatal("Test failed. TestGetOrderbook retrieved non-existant orderbook using invalid second currency") + t.Fatal("Test failed. TestGetOrderbook retrieved non-existent orderbook using invalid second currency") } } diff --git a/smsglobal/smsglobal.go b/smsglobal/smsglobal.go index d5cc5aab..86c98761 100644 --- a/smsglobal/smsglobal.go +++ b/smsglobal/smsglobal.go @@ -36,7 +36,7 @@ type Base struct { SendFrom string `json:"send_from"` } -// New initalises the SMSGlobal var +// New initialises the SMSGlobal var func New(username, password, sendFrom string, contacts []Contact) *Base { if username == "" || password == "" || sendFrom == "" || len(contacts) == 0 { return nil diff --git a/smsglobal/smsglobal_test.go b/smsglobal/smsglobal_test.go index 8fcd287f..b4d9eab1 100644 --- a/smsglobal/smsglobal_test.go +++ b/smsglobal/smsglobal_test.go @@ -52,7 +52,7 @@ func TestGetContactByNumber(t *testing.T) { _, err = result.GetContactByNumber("ASDASDASD") if err == nil { - t.Fatal("Test failed. TestGetContactByNumber: Returned nil err on non-existant number") + t.Fatal("Test failed. TestGetContactByNumber: Returned nil err on non-existent number") } } @@ -73,7 +73,7 @@ func TestGetContactByName(t *testing.T) { _, err = result.GetContactByName("ASDASDASD") if err == nil { - t.Fatal("Test failed. TestGetContactByName: Returned nil err on non-existant number") + t.Fatal("Test failed. TestGetContactByName: Returned nil err on non-existent number") } }