-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing error for precompiled testing packages #597
Comments
I'm currently having the same issue. @tonobo Were you ever able to find a workaround? |
This patch to github.com/spf13/pflag seems to make it work: diff --git a/flag.go b/flag.go
index 5eadc84..31f2cbd 100644
--- a/flag.go
+++ b/flag.go
@@ -990,11 +990,11 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin
}
func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parseFunc) (outShorts string, outArgs []string, err error) {
+ outArgs = args
if strings.HasPrefix(shorthands, "test.") {
return
}
- outArgs = args
outShorts = shorthands[1:]
c := shorthands[0]
|
@eparis Thanks, that worked for me! |
shin-
added a commit
to shin-/pflag
that referenced
this issue
May 2, 2018
Based on patch suggested here: spf13/cobra#597 (comment)
eparis
pushed a commit
to spf13/pflag
that referenced
this issue
Jun 1, 2018
Based on patch suggested here: spf13/cobra#597 (comment)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have an binary which requires an external testing but i'm currently unable to do so with coverage tracking enabled. Please take a look at the following samples.
Creating test binary:
go test -covermode=count -coverpkg ./... -o test-bin
Sample 1.
Sample 2.
The text was updated successfully, but these errors were encountered: