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

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

griesemer opened this issue Mar 9, 2018 · 1 comment


Copy link

@griesemer griesemer commented Mar 9, 2018

gofmt changes the code

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


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.

@griesemer griesemer added the NeedsFix label Mar 9, 2018
@griesemer griesemer added this to the Go1.11 milestone Mar 9, 2018
@griesemer griesemer self-assigned this Mar 9, 2018
@griesemer griesemer modified the milestones: Go1.11, Go1.12 Jun 27, 2018
@griesemer griesemer modified the milestones: Go1.12, Go1.13 Oct 24, 2018

This comment has been minimized.

Copy link
Contributor Author

@griesemer griesemer commented Oct 24, 2018

Moving to 1.13. No urgent need has come up for this.

@griesemer griesemer modified the milestones: Go1.13, Go1.14 May 6, 2019
@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.