imported env module
This commit is contained in:
14
env/string.go
vendored
Normal file
14
env/string.go
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
package env
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// Get an environment variable, specifying a default value if its not set
|
||||
func String(key string, defaultValue string) string {
|
||||
val, exists := os.LookupEnv(key)
|
||||
if !exists {
|
||||
return defaultValue
|
||||
}
|
||||
return val
|
||||
}
|
||||
Reference in New Issue
Block a user