-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/compile: error message should not mention -lang when //go:build set file version #63489
Comments
How about making the error more generic, something like:
|
@cuonglm I think it's worthwhile to keep the current language version in the error message. For example, if the error message for Russ's example mentioned "go1.4", then users can grep for occurrences of that string to find immediately what needs to be changed. Also, the compiler knows whether the version was set by -lang or //go:build, so I think we should just tell users which file it came from, rather than making them look in both places. |
Yeah, I realized that now we have |
Change https://go.dev/cl/534755 mentions this issue: |
Change https://go.dev/cl/536055 mentions this issue: |
While at it, also using "slices" package to simplify code. For #63489 Change-Id: I72b325f6ad379b996c108145885fa71706f6659f Reviewed-on: https://go-review.googlesource.com/c/go/+/536055 Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Cuong Manh Le <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
While at it, also using "slices" package to simplify code. For golang#63489 Change-Id: I72b325f6ad379b996c108145885fa71706f6659f Reviewed-on: https://go-review.googlesource.com/c/go/+/536055 Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Cuong Manh Le <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
Fixes golang#63489 Change-Id: I5e02dc5165ada7f5c292d56203dc670e96eaf2c1 Reviewed-on: https://go-review.googlesource.com/c/go/+/534755 Auto-Submit: Cuong Manh Le <[email protected]> Reviewed-by: Than McIntosh <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
The parenthetical misleads. It should say something like "(file declares //go:build go1.4)" or just be removed unconditionally.
The text was updated successfully, but these errors were encountered: