Adding a comment noting that the Sub() method doesn't return a fully functional viper object

This commit is contained in:
Lucas Vogelsang 2018-06-02 08:57:57 -04:00
parent 15738813a0
commit 4d7e75d1a0
No known key found for this signature in database
GPG Key ID: FD9F9D3259972025
1 changed files with 3 additions and 1 deletions

View File

@ -648,7 +648,9 @@ func (v *Viper) Get(key string) interface{} {
}
// Sub returns new Viper instance representing a sub tree of this instance.
// Sub is case-insensitive for a key.
// Sub is case-insensitive for a key. The Viper object that is returned however
// is not a fully functional `Viper`. It will not include any values set with
// BindEnv and Unmarshal is not supported.
func Sub(key string) *Viper { return v.Sub(key) }
func (v *Viper) Sub(key string) *Viper {
subv := New()