forked from containers/toolbox
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/root, pkg/utils: Add support for configuration files
It looks like there are some oddities with Viper [1]. The errors can't be examined with errors.As [2] and Viper doesn't actually throw ConfigFileNotFoundError if a configuration file is not found. Secondly, there's no way to find out if a key was actually specified in a configuration file. The InConfig API doesn't return 'true' even if a key was mentioned in a configuration file, and the IsSet API returns 'true' even if the key was only set via SetDefault in the code. Some changes by Debarshi Ray. [1] https://pkg.go.dev/github.com/spf13/viper [2] https://blog.golang.org/go1.13-errors containers#828 containers#851
- Loading branch information
1 parent
ffdfaa7
commit 20f4f68
Showing
4 changed files
with
116 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters