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: preserve line break after ( in func signature #2597

Closed
gopherbot opened this issue Dec 21, 2011 · 7 comments
Closed

go/printer: preserve line break after ( in func signature #2597

gopherbot opened this issue Dec 21, 2011 · 7 comments
Milestone

Comments

@gopherbot
Copy link

by jacobsa@google.com:

What steps will reproduce the problem?
1.
2.
3.

The revision that closed issue #1524 fixed most of the problems with this
example, but it's still not great. If you have a function that is long enough
that you split its parameter onto separate lines:

    $ cat foo.go 
    package foo
    
    func ManageStatus(
        in <-chan *Status,
        req <-chan Request,
        stat chan<- *TargetInfo,
        TargetHistorySize int) {
    }

then gofmt will yank the first parameter back to the first line, making it not
align with the rest:

    $ gofmt foo.go 
    package foo
    
    func ManageStatus(in <-chan *Status,
        req <-chan Request,
        stat chan<- *TargetInfo,
        TargetHistorySize int) {
    }

Is this intentional? I personally find it easier to read when the parameters
line up.

Which revision are you using?  (hg identify)

    82fdc445f2ff weekly/weekly.2011-12-14
@gopherbot
Copy link
Author

Comment 1 by jacobsa@google.com:

Leave it to me to file an "attention to detail" bug that leaves in form junk
at the top and has a typo in the second sentence. Sigh.

@griesemer
Copy link
Contributor

Comment 2:

Owner changed to @griesemer.

Status changed to Accepted.

@adg
Copy link
Contributor

adg commented Jan 4, 2012

Comment 3:

Labels changed: added priority-go1.

@robpike
Copy link
Contributor

robpike commented Jan 13, 2012

Comment 4:

Owner changed to builder@golang.org.

@griesemer
Copy link
Contributor

Comment 5:

Owner changed to @griesemer.

@griesemer
Copy link
Contributor

Comment 7:

This issue was closed by revision d665ea9.

Status changed to Fixed.

@gopherbot
Copy link
Author

Comment 8 by jacobsa@google.com:

Nice, thank you!

@rsc rsc added this to the Go1 milestone Apr 10, 2015
@rsc rsc removed the priority-go1 label Apr 10, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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

5 participants