mirror of
https://github.com/spf13/viper
synced 2025-05-06 12:17:18 +00:00
fixed tabs
This commit is contained in:
parent
ef3911a241
commit
d42cd66967
1 changed files with 5 additions and 5 deletions
10
README.md
10
README.md
|
@ -277,16 +277,16 @@ import (
|
|||
|
||||
func main() {
|
||||
|
||||
// using standard library "flag" package
|
||||
flag.Int("flagname", 1234, "help message for flagname")
|
||||
// using standard library "flag" package
|
||||
flag.Int("flagname", 1234, "help message for flagname")
|
||||
|
||||
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
|
||||
pflag.Parse()
|
||||
viper.BindPFlags(pflag.CommandLine)
|
||||
viper.BindPFlags(pflag.CommandLine)
|
||||
|
||||
i := viper.GetInt("flagname") // retrieve value from viper
|
||||
i := viper.GetInt("flagname") // retrieve value from viper
|
||||
|
||||
...
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue