If I declare constants as follows, I get a const error initializer in os.Getenv ("MY_SECRET") is not a constant. "Why is this?
New to Go, and I see that the Getenv return type is a string, but I don’t understand why this will not work as a constant.
const ( secret = os.Getenv("MY_SECRET") key = os.Getenv("MY_KEY") )
source share