From 4d7e75d1a096066dd0e0e64a4c0f4190e9be305e Mon Sep 17 00:00:00 2001 From: Lucas Vogelsang Date: Sat, 2 Jun 2018 08:57:57 -0400 Subject: [PATCH] Adding a comment noting that the Sub() method doesn't return a fully functional viper object --- viper.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/viper.go b/viper.go index 907a102..18252b5 100644 --- a/viper.go +++ b/viper.go @@ -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()