-
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
x/tools/gopls: make it clearer when diagnostics come from a non-default build context #65496
Comments
The errors are because you have counter_disabled.go open, and gopls automatically creates a View to cover the counter_disabled file. The countertest package does have errors when compiled with counter_disabled.go -- exactly the errors reported. We should make it clearer when the errors are not from the default view of a file. |
To be clear: the change to 386 is irrelevant. You will see these errors as soon as you open counter_disabled.go, without any changes to the repository. |
thanks. I guess the bug should be titled "confusing error messages"
…On Sun, Feb 4, 2024 at 11:52 AM findleyr ***@***.***> wrote:
To be clear: the change to 386 is irrelevant. You will see these errors as
soon as you open counter_disabled.go, without any changes to the repository.
—
Reply to this email directly, view it on GitHub
<#65496 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJIAIYS5PNYYTMEXWXJYI3YR64FTAVCNFSM6AAAAABCYEHL2SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRVHAZDQMRZHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Change https://go.dev/cl/563876 mentions this issue: |
Change https://go.dev/cl/564557 mentions this issue: |
…ostics by OS,ARCH This change adds a disambiguating suffix such as " [windows,arm64]" to diagnostics that do not appear in the default build configuration. Fixes golang/go#65496 Change-Id: Ided7a7110ff630e57b7a96a311a240fef210ca93 Reviewed-on: https://go-review.googlesource.com/c/tools/+/563876 Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> (cherry picked from commit df9c1c7) Reviewed-on: https://go-review.googlesource.com/c/tools/+/564557 Reviewed-by: Alan Donovan <[email protected]>
Go version
go1.21.6
Output of
go env
in your module/workspace:What did you do?
download x/telemetry at tip. Then in counter/counter.go and counter/counter_disabled.go remove the references to 386 in //go:build lines. (one in each file)
What did you see happen?
Type errors on c in counter/countertest/counter_test.go:
cannot use c (variable of type *"golang.org/x/telemetry/counter".Counter) as *"golang.org/x/telemetry/internal/counter".Counter value in argument to ReadCountercompilerIncompatibleAssign
What did you expect to see?
no errors. The tests in countertest/counter_test.go compile without errors and run.
The text was updated successfully, but these errors were encountered: