(flags *flag.FlagSet, pflag *flag.Flag, annotation string, groupStatus map[string]map[string]bool)
| 119 | } |
| 120 | |
| 121 | func processFlagForGroupAnnotation(flags *flag.FlagSet, pflag *flag.Flag, annotation string, groupStatus map[string]map[string]bool) { |
| 122 | groupInfo, found := pflag.Annotations[annotation] |
| 123 | if found { |
| 124 | for _, group := range groupInfo { |
| 125 | if groupStatus[group] == nil { |
| 126 | flagnames := strings.Split(group, " ") |
| 127 | |
| 128 | // Only consider this flag group at all if all the flags are defined. |
| 129 | if !hasAllFlags(flags, flagnames...) { |
| 130 | continue |
| 131 | } |
| 132 | |
| 133 | groupStatus[group] = make(map[string]bool, len(flagnames)) |
| 134 | for _, name := range flagnames { |
| 135 | groupStatus[group][name] = false |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | groupStatus[group][pflag.Name] = pflag.Changed |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | func validateRequiredFlagGroups(data map[string]map[string]bool) error { |
| 145 | keys := sortedKeys(data) |
no test coverage detected