To ensure loaded data from configuration files override default application values and CLI flags always take precedence over all other loaded states the overall loading logic must be refactored.
It can be achieved by implementing a command initialization function (called before each command) that merges the configuration states in the correct order.
Also the loading logic will be moved from pkg/config/constants.go into the pkg/config/config.go file to better separate the purpose of both files.
To ensure loaded data from configuration files override default application values and CLI flags always take precedence over all other loaded states the overall loading logic must be refactored. It can be achieved by implementing a command initialization function (called before each command) that merges the configuration states in the correct order. Also the loading logic will be moved from
pkg/config/constants.go
into thepkg/config/config.go
file to better separate the purpose of both files.