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: blank lines at top/bottom of composite literal handled differently by gofmt #23143

Closed
willfaught opened this issue Dec 14, 2017 · 4 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@willfaught
Copy link
Contributor

Searched and didn't find a duplicate issue.

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

play.golang.org

What did you do?

var x = []int{

	1,
	2,
	3,

}

https://play.golang.org/p/xDO9L4ROUA (press the format button)

What did you expect to see?

Either both blank lines in the composite literal removed, or neither of them removed.

What did you see instead?

The bottom blank line is removed, but not the top.

@bradfitz bradfitz added this to the Unplanned milestone Dec 15, 2017
@bradfitz bradfitz changed the title cmd/fmt: blank lines at top/bottom of composite literal handled differently go/printer: blank lines at top/bottom of composite literal handled differently by gofmt Dec 15, 2017
@bradfitz
Copy link
Contributor

The typical answer to gofmt bug reports is to relax and accept whatever gofmt gives you, but I'll let @griesemer decide. This might be a dup of #6996.

@willfaught
Copy link
Contributor Author

Ah, could be. I searched for composite literals specifically, but it could be a more general block issue.

@griesemer
Copy link
Contributor

See also #18264. Leaving open for now.

@griesemer griesemer modified the milestones: Unplanned, Go1.11 Dec 15, 2017
@griesemer griesemer modified the milestones: Go1.11, Unplanned Jun 27, 2018
@ALTree ALTree added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Mar 3, 2019
@willfaught
Copy link
Contributor Author

Closing due to no activity.

@willfaught willfaught closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2022
@golang golang locked and limited conversation to collaborators Nov 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

5 participants