-
Notifications
You must be signed in to change notification settings - Fork 17.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
x/tools/cmd/stringer: does not honor build tags #9449
Labels
Milestone
Comments
Not obvious it should or should not honor tags, but it needs to be thought about. There are arguments both ways. |
Change https://golang.org/cl/121995 mentions this issue: |
Change https://golang.org/cl/122537 mentions this issue: |
gopherbot
pushed a commit
to golang/tools
that referenced
this issue
Jul 10, 2018
This is reapplying CL121995 after rolling back the change to the importing methods. There is still a need for a flag to control tags. The original CL decription: The feature has been requested but, like build tags in general, only works in a directory, not when files are specified explicitly. Unlike the build tools, report when the feature is misused like this to avoid confusion. Fixes golang/go#9449 Change-Id: I732627d5f2e6323367e3bdd5de746923868890a9 Reviewed-on: https://go-review.googlesource.com/122537 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
SOF3
pushed a commit
to SOF3/go-stringer-inverse
that referenced
this issue
Aug 23, 2018
The feature has been requested but, like build tags in general, only works in a directory, not when files are specified explicitly. Unlike the build tools, report when the feature is misused like this to avoid confusion. Fixes golang/go#9449 Change-Id: I079d363c5eeb5bc647fd2f0f3d88d28d630644d8 Reviewed-on: https://go-review.googlesource.com/121995 Reviewed-by: Ian Lance Taylor <iant@golang.org>
SOF3
pushed a commit
to SOF3/go-stringer-inverse
that referenced
this issue
Aug 23, 2018
This is reapplying CL121995 after rolling back the change to the importing methods. There is still a need for a flag to control tags. The original CL decription: The feature has been requested but, like build tags in general, only works in a directory, not when files are specified explicitly. Unlike the build tools, report when the feature is misused like this to avoid confusion. Fixes golang/go#9449 Change-Id: I732627d5f2e6323367e3bdd5de746923868890a9 Reviewed-on: https://go-review.googlesource.com/122537 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
SOF3
pushed a commit
to SOF3/go-stringer-inverse
that referenced
this issue
Aug 23, 2018
The feature has been requested but, like build tags in general, only works in a directory, not when files are specified explicitly. Unlike the build tools, report when the feature is misused like this to avoid confusion. Fixes golang/go#9449 Change-Id: I079d363c5eeb5bc647fd2f0f3d88d28d630644d8 Reviewed-on: https://go-review.googlesource.com/121995 Reviewed-by: Ian Lance Taylor <iant@golang.org>
SOF3
pushed a commit
to SOF3/go-stringer-inverse
that referenced
this issue
Aug 23, 2018
This is reapplying CL121995 after rolling back the change to the importing methods. There is still a need for a flag to control tags. The original CL decription: The feature has been requested but, like build tags in general, only works in a directory, not when files are specified explicitly. Unlike the build tools, report when the feature is misused like this to avoid confusion. Fixes golang/go#9449 Change-Id: I732627d5f2e6323367e3bdd5de746923868890a9 Reviewed-on: https://go-review.googlesource.com/122537 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What does 'go version' print?
Additionally,
stringer
source is at this commit:79d60d6
What steps reproduce the problem?
Create file A with
// +build foo
and file B with// +build bar
which both declare a string likeconst BANG = "hello"
.Build the package.
What happened?
go generate
failed like this:What should have happened instead?
The files using build tags have nothing to do with the code using
//go:generate
, so I expect stringer to work as designed.The text was updated successfully, but these errors were encountered: