DEV Community

Discussion on: Clean Configuration Management in Golang

 
ilyakaznacheev profile image
Ilya Kaznacheev

I think you can just use gopkg.in/yaml.v2 to encrypt any structure to YAML and print it to the file. So you don't need any special logic here, because your app prepares some data (which is out of the scope of how to push it to the file), and then you just need to save it.

You also can use default json or toml encoders if you want. No real need to build something extra.