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/gofmt: unaligned fields when a short field name is followed by a long field name #20500

Closed
hyangah opened this issue May 25, 2017 · 1 comment
Closed

Comments

@hyangah
Copy link
Contributor

@hyangah hyangah commented May 25, 2017

The following is gofmt'd code.

	a := &A{
		Cell: 2,
		F01234567890123456789: 3,
	}

Visit https://play.golang.org/p/t6fy24Nb-g and run "Format" button.

What version of Go are you using (go version)?

go1.8.1

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented May 25, 2017

This is intentional and has come up periodically in the past. (e.g. #20258, #10392, etc)

gofmt has heuristics to not make large jumps if one field is much longer than the others.

@bradfitz bradfitz closed this May 25, 2017
@golang golang locked and limited conversation to collaborators May 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.