Keep track of environment variables in go
When we configure our programs, we usually have three ways to do it: config files, cli flags and environment variables. While all of these three options are a solid way to go, with CI/CD environments you are usually instructed to use environment variables, e.g. envvars.
If we look at the golang’s os package documentation, we can see that it offers multiple ways to read envvars:
Environ
which gives you raw list of strings in form of “key=value” which you can parse your selfGetenv
which gives you the envvar value if it exists, or an empty stringLookupEnv
which is similar to Getenv, but also returns you a boolean telling you if the variable exists or not