Bump golangci-lint to v1.24.0, linter fixes and general code improvements (#478)

* Bump golangci-lint version, update Go version deps and generic code improvements

* Fix wesbocket resp nil check and zip closures

* Update pprof path
This commit is contained in:
Adrian Gallagher
2020-04-09 13:07:32 +10:00
committed by GitHub
parent 4748a7849c
commit 0d787bc259
47 changed files with 193 additions and 178 deletions

View File

@@ -172,8 +172,9 @@ func (c *Config) PurgeExchangeAPICredentials() {
// GetCommunicationsConfig returns the communications configuration
func (c *Config) GetCommunicationsConfig() CommunicationsConfig {
m.Lock()
defer m.Unlock()
return c.Communications
comms := c.Communications
m.Unlock()
return comms
}
// UpdateCommunicationsConfig sets a new updated version of a Communications
@@ -187,8 +188,9 @@ func (c *Config) UpdateCommunicationsConfig(config *CommunicationsConfig) {
// GetCryptocurrencyProviderConfig returns the communications configuration
func (c *Config) GetCryptocurrencyProviderConfig() CryptocurrencyProvider {
m.Lock()
defer m.Unlock()
return c.Currency.CryptocurrencyProvider
provider := c.Currency.CryptocurrencyProvider
m.Unlock()
return provider
}
// UpdateCryptocurrencyProviderConfig returns the communications configuration
@@ -677,8 +679,9 @@ func (c *Config) GetCurrencyPairDisplayConfig() *CurrencyPairFormatConfig {
// GetAllExchangeConfigs returns all exchange configurations
func (c *Config) GetAllExchangeConfigs() []ExchangeConfig {
m.Lock()
defer m.Unlock()
return c.Exchanges
configs := c.Exchanges
m.Unlock()
return configs
}
// GetExchangeConfig returns exchange configurations by its indivdual name
@@ -708,8 +711,9 @@ func (c *Config) GetForexProvider(name string) (currency.FXSettings, error) {
// GetForexProviders returns a list of available forex providers
func (c *Config) GetForexProviders() []currency.FXSettings {
m.Lock()
defer m.Unlock()
return c.Currency.ForexProviders
fxProviders := c.Currency.ForexProviders
m.Unlock()
return fxProviders
}
// GetPrimaryForexProvider returns the primary forex provider