ParseSkippedFlags explicitly Parses go test flags (i.e. the one starting with '-test.') with goflag.Parse(), since by default those are skipped by pflag.Parse(). Typical usage example: `ParseGoTestFlags(os.Args[1:], goflag.CommandLine)`
(osArgs []string, goFlagSet *goflag.FlagSet)
| 150 | // since by default those are skipped by pflag.Parse(). |
| 151 | // Typical usage example: `ParseGoTestFlags(os.Args[1:], goflag.CommandLine)` |
| 152 | func ParseSkippedFlags(osArgs []string, goFlagSet *goflag.FlagSet) error { |
| 153 | var skippedFlags []string |
| 154 | for _, f := range osArgs { |
| 155 | if isGotestFlag(f) { |
| 156 | skippedFlags = append(skippedFlags, f) |
| 157 | } |
| 158 | } |
| 159 | return goFlagSet.Parse(skippedFlags) |
| 160 | } |
| 161 |