-
Notifications
You must be signed in to change notification settings - Fork 281
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
go-fuzz-build: added support for '-tags' #151
Conversation
go-fuzz-build/main.go
Outdated
@@ -24,6 +24,7 @@ import ( | |||
) | |||
|
|||
var ( | |||
flagTag = flag.String("tags", "", "a list of build tags to consider satisfied during the build.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proper way of doing it is using: https://godoc.org/golang.org/x/tools/go/buildutil#TagsFlag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I was not aware there was a tags flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I'm looking at it I'm not sure I want to pull in a new package just for a flag. I'll let @dvyukov decide on whether he'd like this or not.
if len(*flagTag) > 0 { | ||
tags += " " + *flagTag | ||
} | ||
return tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Joined tags should have form -tags="tagA tagB"
try it out for yourself.
See also: golang/go#8772 (comment)
Thins get a bit tricky when you have multiple tags in play.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, indeed. This works though, it should be a space separated list of tags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you mean that they need to be quoted, that's handled by the exec.Command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, rigth, sorry.
go-fuzz-build/main.go
Outdated
@@ -24,6 +24,7 @@ import ( | |||
) | |||
|
|||
var ( | |||
flagTag = flag.String("tags", "", "a list of build tags to consider satisfied during the build.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/a list/a space-separated list/ please
also no dot at the end, other flags don't use dots
Otherwise looks good. |
ae8173d
to
65a9ad3
Compare
Done |
65a9ad3
to
5397bca
Compare
Thanks! |
go-fuzz-build: added support for '-tags'
Please let me know if this is something that might be of interest and/or if you want me to expand further.