I think people are focusing on the wrong part of Jakob's reply. Focus on
the "if your line is too long, it's probably a symptom of a too complicated
expression" part, not the "line-length limit doesn't matter" part.

I am very rarely exceeding 80 columns. For example:

var h http.Handler

h = handlers.LoggingHandler(os.Stderr, http.HandlerFunc(lh.LoginHandler))
mux.Handle("/login", h)

h = http.HandlerFunc(lh.AddReferrerHandler)
h = auth.IsReferrer(h)
h = auth.IsAuthenticated(h)
h = auth.Trace(h)
h = handlers.LoggingHandler(os.Stderr, h)
mux.Handle("/add-referrer", h)

Personally, I find that much more readable anyway…

On Fri, Sep 8, 2017 at 6:27 PM, Drew Derbyshire <a...@kew.com> wrote:

> I haven't edited on a true text mode terminal since 1992, but a column
> limit is still useful.  This and the other Go standards for relatively
> fixed formatting are not its strong suit.
>
> On Wednesday, September 6, 2017 at 11:36:04 PM UTC-7, Jakob Borg wrote:
>>
>> On 7 Sep 2017, at 06:10, Sankar <sankar.c...@gmail.com> wrote:
>> >
>> > Are there any tools available for golang to split long functions so
>> that they can fit in 80 columns (as long as possible) ?
>>
>> Don't fear longer lines, most of us are not on text mode terminals any
>> more. :)
>>
>> When it becomes *too* long it's probably hard to read due to being a too
>> large or too complex expression, not the line length per se. My preferred
>> solution would be to split it up with a variable or two. I don't think
>> there is a tool for that, it requires human consideration.
>>
>> //jb
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to