golang-developer-roadmap
golang-developer-roadmap copied to clipboard
Any recommendation for configuration management package?
There could be a lot of approach to store your configuration to some file such as JSON, YAML, TOML, INI and etc. I wonder what's the proposed way to read/write configuration file in golang?
@hdw868 Please provide some more explanation.
@hdw868 Please provide some more explanation.
I edit my description : )
There could be a lot of approach to store your configuration to some file such as JSON, YAML, TOML, INI and etc. I wonder what's the proposed way to read/write configuration file in golang?
@hdw868 Well you can use the built-in os
package to read and write files.
Viper is good choice if you want some complicated logic and wanna keep it easier to handle. Like JSON(YAML) + env variables. But it could be overwhelmed if you have just a few variables, then os
(to read) and any package to parse json or yaml or whatever you want would be enough. That is my view :)
Also take a look at this list of packages