viper is a powerful Go package that supports a plethora of options. All viper projects follow a pattern. First, you initialize viper and then you define the elements that interest you. After that, you get these elements and read their values in order to use them. Notice that the viper package can entirely replace the flag package.
The desired values can be either taken directly, as happens when you are using the flag package of the standard Go library, or indirectly using configuration files. When using formatted configuration files in the JSON, YAML, TOML, HCL, or Java properties format, viper does all the parsing for you, which saves you from having to write and debug lots of Go code. viper also allows you to extract and save values in Go structures. However, this also requires the fields of the Go structure to match the keys of the configuration file.
The...