Hi,

I would liked that gofmt would handle this one also in order to avoid 
battles about what is the correct line wrapping in go.

In Effective Go there is a section, with smaller fonts than the usual 
document that states:

Line lengthGo has no line length limit. Don't worry about overflowing a 
punched card. If a line feels too long, wrap it and indent with an extra 
tab.

The above line leaves a lot of room for interpretation:

Assume you have something lengthy, which is also left for interpretation, 
you should wrap and ident with an extra tab:

Now I have the following outcomes:

shinyThing := New(argument1 string, argument2 string, argument3 string,
  argument4 string, argument5 string)


you have

shinyThing  := New(
  argument1 string, 
  argument2 string, 
  argument3 string,
  argument4 string, 
  argument5 string
)

and there are possibly 100 more variations out there.

I personally prefer the first one because I use as much horizontal space as 
I can (i have a limit for 120 chars per line) and I use as little as 
possible vertical space in order to not need to scroll. I optimize for 
having as much as possible in one screen.

Does anybody have a convention that is generally accepted for this?
Would this make sense to be part of gofmt?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/11db50dc-d8e2-4a75-b9a2-bf00ae7f9a89%40googlegroups.com.

Reply via email to