The previous recipe, Creating a program interface with the flag package, describes how to use flags as program parameters.
The other typical way of parameterization, especially for larger applications, is the configuration with the use of environment variables. Environment variables as a configuration option significantly simplify the deployment of the applications. These are also very common in cloud infrastructure.
Usually, the configuration of a database connection for a local and for an automated build environment is different.
If the configuration is defined by the environment variables, it is not necessary to change the application config files or even the application code. ...