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

Comments

@hyangah
Copy link
Contributor

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

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.

@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
Development

No branches or pull requests

3 participants