Skip to content

go/printer, gofmt: line directives specifying columns must stay in place relative to next token #24326

Open
@griesemer

Description

@griesemer

gofmt changes the code

package p
/*line foo:10:12*/func g() /*line :20:13*/{}

to

package p

/*line foo:10:12*/
func g()/*line :20:13*/ {}

which changes the positions of some tokens. Generally, gofmt changes positions, but in the case of line directives specifying specific line and column values we want those values to remain stable.

See also #22662, #24143, and #24183.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions