diff --git a/README.md b/README.md index 09a3d50..f3b3a8a 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,16 @@ Viper configuration keys are case insensitive. fmt.Println("verbose enabled") } +### Deep Configuration Data + + // Materialized paths allow for deep traversal of nested config data. + logger_config := viper.GetStringMap("logger.stdout") + // Or, go even deeper. + logger_base_path := viper.GetString("logger.stdout.base_path") + + // Periods are not valid environment variable names, replace + // materialized path periods with double underscores. + LOGGER__STDOUT__BASE_PATH=/var/log/myapp go run server.go ## Q & A