Fix: viper.UnmarshalKey ignores defaults
This seems to be a bug in viper, as soon as we're working with subkeys, things fall apart
This commit is contained in:
		@@ -22,7 +22,11 @@ func SetConfigDefaults() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func LoadConfig() {
 | 
			
		||||
	viper.UnmarshalKey("WebAPI", &C)
 | 
			
		||||
	// Does not work with partially overrides, only GetXXX does resolve the subkeys correctly
 | 
			
		||||
	// https://github.com/spf13/viper/issues/798
 | 
			
		||||
	// https://github.com/spf13/viper/issues/309
 | 
			
		||||
	// viper.UnmarshalKey("WebAPI", &C)
 | 
			
		||||
	C.ListenAddress = viper.GetString("WebAPI.ListenAddress")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (obj *config) PrettyPrint() string {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user