Skip to content

Commit

Permalink
Slight refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
iph0 committed Aug 3, 2018
1 parent 528510d commit c813527
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ func (p *Processor) Load(locators ...interface{}) (map[string]interface{}, error
return nil, err
}

switch config := iConfig.(type) {
case map[string]interface{}:
return config, nil
default:
config, ok := iConfig.(map[string]interface{})
if !ok {
return nil, fmt.Errorf("%s: loaded configuration has invalid type %T",
errPref, config)
}

return config, nil
}

func (p *Processor) load(locators []interface{}) (interface{}, error) {
Expand Down

0 comments on commit c813527

Please sign in to comment.