-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/node: simplify flag declarations
We already rely on viper to fill the config type via viper.Unmarshal, so there is no need to use APIs like flag.StringVar to directly link the flags to struct field pointers in the config. A few exceptions are config entries like DataDir or Vochain.Network, which are used to know where to read the config YAML file itself. Those keep the viper.Get calls that were still present, which still allow us to avoid the flag pointer business, and support taking values from env vars as well. Once again, verified that a newly generated YAML config is the same.
- Loading branch information
Showing
1 changed file
with
53 additions
and
49 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