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

@@ -1244,12 +1244,7 @@ func (c *Config) SaveConfig(configPath string) error {
return err
}
}
err = common.WriteFile(defaultPath, payload)
if err != nil {
return err
}
return nil
return common.WriteFile(defaultPath, payload)
}
// CheckConfig checks all config settings
@@ -1279,12 +1274,7 @@ func (c *Config) CheckConfig() error {
c.GlobalHTTPTimeout = configDefaultHTTPTimeout
}
err = c.CheckClientBankAccounts()
if err != nil {
return err
}
return nil
return c.CheckClientBankAccounts()
}
// LoadConfig loads your configuration file into your configuration object
@@ -1318,12 +1308,7 @@ func (c *Config) UpdateConfig(configPath string, newCfg Config) error {
return err
}
err = c.LoadConfig(configPath)
if err != nil {
return err
}
return nil
return c.LoadConfig(configPath)
}
// GetConfig returns a pointer to a configuration object

View File

@@ -57,11 +57,7 @@ func PromptForConfigKey(initialSetup bool) ([]byte, error) {
log.Println("Please enter in your password: ")
pwPrompt := func(i *[]byte) error {
_, err := fmt.Scanln(i)
if err != nil {
return err
}
return nil
return err
}
var p1 []byte

View File

@@ -54,7 +54,7 @@ func TestUpdateExchangeBankAccounts(t *testing.T) {
var count int
for _, exch := range cfg.Exchanges {
if exch.Name == "Bitfinex" {
if exch.BankAccounts[0].Enabled == false {
if !exch.BankAccounts[0].Enabled {
count++
}
}
@@ -109,7 +109,7 @@ func TestUpdateClientBankAccounts(t *testing.T) {
var count int
for _, bank := range cfg.BankAccounts {
if bank.BankName == b.BankName {
if bank.Enabled == false {
if !bank.Enabled {
count++
}
}
@@ -518,7 +518,7 @@ func TestGetRequestCurrencyPairFormat(t *testing.T) {
)
}
exchFmt, err := cfg.GetRequestCurrencyPairFormat("Bitfinex")
exchFmt, err := cfg.GetRequestCurrencyPairFormat("Yobit")
if exchFmt.Uppercase || exchFmt.Delimiter != "_" || exchFmt.Separator != "-" {
t.Errorf(
"Test failed. TestGetRequestCurrencyPairFormat. Invalid values",