Skip to content

If I must manually check the config viper got and set the flag of cmd? #1266

Answered by acehinnnqru
acehinnnqru asked this question in Q&A
Discussion options

You must be logged in to vote

OK, I know how to use it now.

I thought the variable var in cobra.Flags().StringPVar(&var,...) would be set automatically...
I got to know that I was wrong. Viper will automatically got the var but all var should be retrived through viper.Get*() manually.

Thanks, anyway.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by acehinnnqru
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant