github.com/krostar/config (go): Package config is a light yet powerful config loader.  Configuration loading is as easy as:  See each sources to get more details on how to use them.  Set default recursively by walking through any types and try to apply defaults.  A default is applied if the type implement the setDefaultFunc interface and the actual value is the zero value of the type.  Considering the following structure:  If we want to apply defaults to an instance of furniture, we just have to:  We already see that the SetDefault method will be call if any value is the zero value and value's type implements SetDefault. There is two exception:  If the type is a pointer:  If it's a struct field with the `default:"-"` tag:  Configuration validation can be made to validate types implementing validateFunc. It recursively walk through any types and call validateFunc if defined, for any of them.  Considering the following structure:  If we want to validate to an instance of furniture, we just have to:
Keywords: config-default|config-loader|config-management