From 9da232898a2e2ab136d81bb45554053f5b42fed4 Mon Sep 17 00:00:00 2001 From: Harrison Date: Sat, 9 Apr 2016 09:46:12 +1000 Subject: [PATCH] Add note on Environment translation Fix #4 --- README.md | 2 ++ environment.go | 1 + 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 3b51c5d..79a493b 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,8 @@ func init() { ``` The configuration stage is where you configure `configure` by adding Checkers to the stack. Checkers are objects which will attempt to retrieve your variables from their respective data sources. When a `Checker` fails the next one in the stack is called, the stack is in the same order that the `Checker`'s were added in. You can configure `configure` anytime before you call the `conf.Parse()` function, but the `init()` function provides a reliable place to do so. +*note:* When using the `Environment `Checker`, all keys will be translated to uppercase and have dashes replaced with underscores (ie. `hello-world` to `HELLO_WORLD`). + ### Stage Three : Usage ```go func main() { diff --git a/environment.go b/environment.go index 10ac782..4b0e438 100644 --- a/environment.go +++ b/environment.go @@ -8,6 +8,7 @@ import ( ) // NewEnvironment creates a new instance of the Environment Checker. +// Note: If you request a value "peanut-butter", the environment variable that will be checked is `PEANUT_BUTTER`. func NewEnvironment() *Environment { return &Environment{} }