Skip to content

cmd/internal/testdir: test constraint parsing fails when test sources are gofmt'd #62267

@bcmills

Description

@bcmills

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.

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.TestingAn issue that has been verified to require only test changes, not just a test failure.compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions