xref: /aosp_15_r20/development/tools/repo_diff/service/repodiff/constants/config.go (revision 90c8c64db3049935a07c6143d7fd006e26f8ecca)
1package constants
2
3import (
4	"os"
5)
6
7func GetConfigVar(key string) string {
8	if os.Getenv("ROLE") == "prod" {
9		key += "_PROD"
10	} else if os.Getenv("ROLE") == "dev" {
11		key += "_DEV"
12	} else {
13		panic("Application has not been executed correctly. Specify environment variable 'ROLE' as either 'dev' or 'prod'")
14	}
15	return os.Getenv(key)
16}
17