From 41e1fdeb7a40c1aee13bc16914ec76f95c6a010b Mon Sep 17 00:00:00 2001 From: Go Frendi Gunawan Date: Tue, 4 Jun 2019 11:25:58 +0700 Subject: [PATCH] Update README.md To avoid confusion, it is better to use `localCmd` instead of `rootCmd` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ff16e3f6..fed4dd87 100644 --- a/README.md +++ b/README.md @@ -336,7 +336,7 @@ rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose out A flag can also be assigned locally which will only apply to that specific command. ```go -rootCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") +localCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") ``` ### Local Flag on Parent Commands