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
At the moment there's a lot of code necessary for accessing the configuration file, and updating it is a real headache. We should consider something more declarative, so we can modify more-or-less one place, and have it work properly (load/save etc). Also, coordinating the command-line args and environment variables vs config would be nice.
This probably relates to "Don't store app state in configuration file #238"
The text was updated successfully, but these errors were encountered:
There's a million "configuration frameworks" for golang, but we should try and be careful not to add another poorly maintained (or overly complex/big) upstream just for this.
eg https://reposhub.com/go/configuration
In Go you can get a lot of typing/structure very easily.
If you use https://pkg.go.dev/gopkg.in/yaml.v2#Unmarshal the type/structure is defined in go structs, and the library will expect sequence/mappings and certain YAML values depending on the corresponding struct/field in Go.
Viper looks good, but probably major overkill https://github.com/spf13/viper
And fwiw Cobra could manage/generate our CLI interfaces (but would be refactor without end-user value)
At the moment there's a lot of code necessary for accessing the configuration file, and updating it is a real headache. We should consider something more declarative, so we can modify more-or-less one place, and have it work properly (load/save etc). Also, coordinating the command-line args and environment variables vs config would be nice.
This probably relates to "Don't store app state in configuration file #238"
The text was updated successfully, but these errors were encountered: