linter fixes

This commit is contained in:
ston1th 2021-11-07 13:30:22 +01:00
commit df5babf6c8
15 changed files with 49 additions and 55 deletions

View file

@ -25,7 +25,7 @@ type ServiceManager interface {
type HAProxyManager struct {
// protects config update
sync.Mutex
mu sync.Mutex
configFile string
svc ServiceManager
@ -61,7 +61,7 @@ func (ha *HAProxyManager) checkConfig(ctx context.Context, lbs Config) (hash []b
return
}
hash = h.Sum(nil)
err = os.Chmod(tmp.Name(), 0640)
err = os.Chmod(tmp.Name(), 0o640)
if err != nil {
return
}
@ -95,7 +95,7 @@ func (ha *HAProxyManager) updateConfig(ctx context.Context, lbs Config) error {
return nil
}
ha.reload = true
file, err := os.OpenFile(ha.configFile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
file, err := os.OpenFile(ha.configFile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o644)
if err != nil {
return err
}
@ -110,8 +110,8 @@ func (ha *HAProxyManager) updateConfig(ctx context.Context, lbs Config) error {
}
func (ha *HAProxyManager) UpdateConfig(ctx context.Context, lbs Config) error {
ha.Lock()
defer ha.Unlock()
ha.mu.Lock()
defer ha.mu.Unlock()
err := ha.updateConfig(ctx, lbs)
if err != nil {
return err