From c5a9056e3ba202155b07b2636d9a98e67eccd091 Mon Sep 17 00:00:00 2001 From: spf13 Date: Fri, 11 Jul 2014 10:41:45 -0400 Subject: [PATCH] Better naming of the Marshal functionality. --- viper.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/viper.go b/viper.go index 709349c..e563e74 100644 --- a/viper.go +++ b/viper.go @@ -96,13 +96,13 @@ func GetStringMapString(key string) map[string]string { return cast.ToStringMapString(Get(key)) } -// takes a map and uses reflection to convert it into the given Go native structure. -// rawVal must be a pointer to a struct. -func GetIntoStruct(key string, rawVal interface{}) error { +// Takes a single key and marshals it into a Struct +func MarshalKey(key string, rawVal interface{}) error { return mapstructure.Decode(Get(key), rawVal) } -func GetAllIntoStruct(rawVal interface{}) (err error) { +// Marshals the config into a Struct +func Marshal(rawVal interface{}) (err error) { err = mapstructure.Decode(defaults, rawVal) if err != nil { return