Skip to content
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/internal/testdir: test constraint parsing fails when test sources are gofmt'd #62267

Closed
bcmills opened this issue Aug 24, 2023 · 1 comment
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Aug 24, 2023

In https://go.dev/cl/522495 I attempted to fix a test failure by editing test/fixedbugs/issue10607.go.

My editor invoked gopls to format the file on save, which added a //go:build line to the file and added a newline after the // +build line. I assumed that would be ok, because nothing about the test is specific to the parser.

However, that caused the action parsing in testdir_test.run to fail, because it expects the first blank line to follow the “action” comment, not the //go:build line.

@bcmills bcmills added Testing An issue that has been verified to require only test changes, not just a test failure. NeedsFix The path to resolution is known, but the work has not been done. compiler/runtime Issues related to the Go compiler and/or runtime. labels Aug 24, 2023
@bcmills bcmills self-assigned this Aug 24, 2023
@bcmills bcmills added this to the Go1.22 milestone Aug 24, 2023
@gopherbot
Copy link

Change https://go.dev/cl/522635 mentions this issue: cmd/internal/testdir: parse past gofmt'd //go:build lines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

2 participants