This package provides a utility to load configuration using Viper. It reads two configuration files:
global.json: A global configuration file whose path is specified by theGLOBAL_CONFIGenvironment variable.- Environment-specific configuration files (
development.json,production.json,staging.json): These files are located in theconfigdirectory of the project and are selected based on theENVenvironment variable.
- Set the
GLOBAL_CONFIGenvironment variable to the path of theglobal.jsonfile. - Set the
ENVenvironment variable to one ofdevelopment,production, orstaging. If not set, it defaults todevelopment. - Call
config.InitConfig()to initialize the configuration.