From 96441b4b7414b184eb59823c0e6ca5494e4706d8 Mon Sep 17 00:00:00 2001 From: Bruce Wang Date: Thu, 20 Jun 2019 15:08:30 +0800 Subject: [PATCH] BindEnv details specified. Now less confusion. --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 62b002b..f2537ce 100644 --- a/README.md +++ b/README.md @@ -225,9 +225,8 @@ prefix. `BindEnv` takes one or two parameters. The first parameter is the key name, the second is the name of the environment variable. The name of the environment variable is case sensitive. If the ENV variable name is not provided, then -Viper will automatically assume that the key name matches the ENV variable name, -but the ENV variable is IN ALL CAPS. When you explicitly provide the ENV -variable name, it **does not** automatically add the prefix. +Viper will automatically assume that the ENV variable is the prefix + "_" + the key name in ALL CAPS. When you explicitly provide the ENV +variable name which is the second parameter, it **does not** automatically add the prefix, which means if the second parameter is "id", the environment variable is just plain "ID". One important thing to recognize when working with ENV variables is that the value will be read each time it is accessed. Viper does not fix the value when