Skip to content

Commit

Permalink
Rename variable to "p" (#2110)
Browse files Browse the repository at this point in the history
In the example the variable is called `p`, but the check is done on a non-existing field called `s`
  • Loading branch information
martinvisser authored Dec 17, 2020
1 parent bd025cf commit 2a708bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cf/flags/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ func main(){
fc := flags.New()
fc.NewStringFlag("password", "p", "flag for password") //name, short_name and usage of the string flag
fc.Parse(os.Args...) //parse the OS arguments
println("Flag 'password' is set: ", fc.IsSet("s"))
println("Flag 'password' value: ", fc.String("s"))
println("Flag 'password' is set: ", fc.IsSet("p"))
println("Flag 'password' value: ", fc.String("p"))
}
```
Running the above code
Expand Down

0 comments on commit 2a708bd

Please sign in to comment.