DEV Community

loading...

Discussion on: Golang : Work with config files

Collapse
robinhuiser profile image
Robin Huiser

Hi Aditya,

Thanks for sharing your experience with Go and configuration files!!

Reading your article, I hope you do not mind I provide some next steps for improvement considering configuration management in Go?

While your solution works (no doubts), it does impact your code base in either:

  • having separate code bases / branches (one for each environment)
  • embedding environment configuration in your code repository

Going down this path you are forced to generate environment specific binaries which is not in line with best practices (see: 12factor.net/codebase) -- 12 factor apps is a good read, something I hand-over to each developer in my teams!

As a possible next step, I would suggest to have a look at Viper in combination with the Golang port of Spring Cloud Config Server to externalise, centralise, version-control & secure configuration files with Vecosy (github.com/vecosy/vecosy) and for runtime feature flags: github.com/thomaspoignant/go-featu....

Again, thanks for your article and I hope you take my feedback "the right way" - we are here to share and learn from each other!

Best -- Robin

Collapse
adi73 profile image
Aditya Author • Edited

Thanks for the feedback Robin!