You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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
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?
The text was updated successfully, but these errors were encountered: