Skip to content

Commit

Permalink
Use ScopedProvider in Get
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Samylkin committed Mar 11, 2017
1 parent 912b319 commit a33fe48
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions config/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,15 +287,7 @@ func (cv Value) Value() interface{} {

// Get returns a value scoped in the current value
func (cv Value) Get(key string) Value {
if cv.key == "" {
return cv.provider.Get(key)
}

if key == "" {
return cv
}

return cv.provider.Get(cv.key + _separator + key)
return NewScopedProvider(cv.key, cv.provider).Get(key)
}

// this is a quick-and-dirty conversion method that only handles
Expand Down

0 comments on commit a33fe48

Please sign in to comment.