Test: Changes are currently independent of the rest of this project. Tests can currently manually be run with "make test". CL is large, but poses no risk Change-Id: Ia77e073df077257cab96b7ca4e1d99a900d029b2
17 lines
339 B
Go
17 lines
339 B
Go
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)
|
|
}
|