You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
339 B

package constants
import (
"os"
)
func GetConfigVar(key string) string {
if os.Getenv("ROLE") == "prod" {
key += "_PROD"
} else if os.Getenv("ROLE") == "dev" {
key += "_DEV"
} else {
panic("Application has not been executed correctly. Specify environment variable 'ROLE' as either 'dev' or 'prod'")
}
return os.Getenv(key)
}