diff --git a/CHANGELOG b/CHANGELOG index 22f7a08..96a1a04 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ + * Add global `GetEnv` function + v0.2.0 - 2024-06-18 * Add support for environment variables * Include string parsing functions diff --git a/cfger.go b/cfger.go index 28d7617..3407005 100644 --- a/cfger.go +++ b/cfger.go @@ -87,6 +87,11 @@ func (cl *ConfigLoader) Get(key string) OptionalItem { // GetEnv gets a given key from the environment variables. func (cl *ConfigLoader) GetEnv(envKey string) OptionalItem { + return GetEnv(envKey) +} + +// GetEnv gets a given key from the environment variables. +func GetEnv(envKey string) OptionalItem { ev := os.Getenv(envKey) if ev == "" {