1
0
Fork 0

Code cleaning.

This commit is contained in:
Ludovic Fernandez 2017-08-18 02:18:02 +02:00 committed by Traefiker
parent c360395afc
commit 759c269dee
19 changed files with 64 additions and 56 deletions

View file

@ -152,7 +152,7 @@ func (p *Provider) loadConfig() *types.Configuration {
}
for key, frontend := range configuration.Frontends {
if _, ok := configuration.Backends[frontend.Backend]; ok == false {
if _, ok := configuration.Backends[frontend.Backend]; !ok {
delete(configuration.Frontends, key)
}
}
@ -231,7 +231,7 @@ func (p *Provider) checkConstraints(keys ...string) bool {
constraintTags := strings.Split(value, ",")
ok, failingConstraint := p.MatchConstraints(constraintTags)
if ok == false {
if !ok {
if failingConstraint != nil {
log.Debugf("Constraint %v not matching with following tags: %v", failingConstraint.String(), value)
}

View file

@ -282,7 +282,7 @@ func TestKvWatchTree(t *testing.T) {
}
select {
case _ = <-configChan:
case <-configChan:
t.Fatalf("configChan should be empty")
default:
}
@ -371,9 +371,7 @@ func (s *Mock) AtomicDelete(key string, previous *store.KVPair) (bool, error) {
}
// Close mock
func (s *Mock) Close() {
return
}
func (s *Mock) Close() {}
func TestKVLoadConfig(t *testing.T) {
provider := &Provider{