mirror of
https://github.com/spf13/viper
synced 2024-12-22 11:37:02 +00:00
parent
df9f4af211
commit
f2cbaea4c2
1 changed files with 0 additions and 5 deletions
5
viper.go
5
viper.go
|
@ -996,11 +996,6 @@ func (v *Viper) BindFlagValues(flags FlagValueSet) (err error) {
|
|||
}
|
||||
|
||||
// BindFlagValue binds a specific key to a FlagValue.
|
||||
// Example (where serverCmd is a Cobra instance):
|
||||
//
|
||||
// serverCmd.Flags().Int("port", 1138, "Port to run Application server on")
|
||||
// Viper.BindFlagValue("port", serverCmd.Flags().Lookup("port"))
|
||||
//
|
||||
func BindFlagValue(key string, flag FlagValue) error { return v.BindFlagValue(key, flag) }
|
||||
func (v *Viper) BindFlagValue(key string, flag FlagValue) error {
|
||||
if flag == nil {
|
||||
|
|
Loading…
Reference in a new issue