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: consider permitting one-line "enum" const decls #13403

Open
griesemer opened this issue Nov 25, 2015 · 5 comments
Open

go/printer: consider permitting one-line "enum" const decls #13403

griesemer opened this issue Nov 25, 2015 · 5 comments
Labels
NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@griesemer
Copy link
Contributor

A declaration of the form:

const (
    Do = iota; Re; Mi; Fa; Sol; La; Ti;
)

gets formatted as:

const (
    Do = iota
    Re
    Mi
    Fa
    Sol
    La
    Ti
)

The former is close to what in other languages might be achieved with an "enum" declaration. If there's several such simple const decls, the latter form uses undue amount of space w/o much readability benefit.

Consider recognizing this special case and not introduce line-breaks if there were none in the original source.

@griesemer griesemer self-assigned this Nov 25, 2015
@griesemer griesemer added this to the Unplanned milestone Nov 25, 2015
@agnivade
Copy link
Contributor

I can take a stab at this. @griesemer - Let me know if you already had something planned.

@griesemer
Copy link
Contributor Author

griesemer commented Apr 26, 2018

@agnivade You're welcome to investigate and play with it but I am probably not going to look at this (or any related CLs) any time soon. We have a freeze coming up on May 1 and this is not important at all and we many more important issues to tackle at the moment. Thanks.

@agnivade
Copy link
Contributor

Got it. Thanks.

@agnivade agnivade assigned agnivade and unassigned griesemer Apr 26, 2018
@gopherbot
Copy link

Change https://golang.org/cl/109795 mentions this issue: go/printer: allow single-line const enum declarations

@griesemer griesemer added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Sep 5, 2018
@griesemer
Copy link
Contributor Author

The pending CL seems ok but I think we need to determine if we actually want this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

3 participants