I have 2 config files for dev and release mode but I don't know how to implement them with specify mode:
release.config.yml
debug.config.yml
How can I detect Go dev/release mode? Or anyway to use config files like this?
I have 2 config files for dev and release mode but I don't know how to implement them with specify mode:
release.config.yml
debug.config.yml
How can I detect Go dev/release mode? Or anyway to use config files like this?
There's no Go standard library facility for switching between configs depending on environment (as e.g. in Node world) as different users have probably different needs for this. Some frameworks (if you decide to use them) might offer this as their own feature.
Depending on your needs you might consider passing environment name as command line -flag or ENVIRONMENT_VARIABLE value or somehow else detecting it depending on your actual use case and then based on detected environment read relevant config file.