I am following the solution (accepted answer) given here as to load configuration values in Go. So far so good.
However, I want to use standard configuration load functions across different modules of the application and for simplicity and ease of it I am trying to achieve loading configurations without explicitly defining a customer object such as type Configuration struct
.
Because each configuration file would be different and I don't want to define multiple structs and structs everywhere and then change them when a new value is added/deleted in the configurations.
I might be unfair to compare but I am looking for which in python would be just like this:
//in config.py
ENVIRONMENT = 'PROD'
//in main.py
import config
...
if config.ENVIRONMENT == 'PROD':
...
Is there such a possibility?