()
| 40 | } |
| 41 | |
| 42 | func init() { |
| 43 | flagsCmd.Flags().StringVarP(&strp, "string", "s", "foo", "a string") |
| 44 | flagsCmd.Flags().IntVarP(&intp, "number", "n", 42, "an integer") |
| 45 | flagsCmd.Flags().BoolVarP(&boolp, "boolean", "b", false, "a boolean") |
| 46 | |
| 47 | rootCmd.AddCommand(flagsCmd) |
| 48 | } |
| 49 | |
| 50 | func flagsFunc(cmd *cobra.Command, args []string) { |
| 51 | fmt.Println("string:", strp) |
nothing calls this directly
no outgoing calls
no test coverage detected