I've never been able to understand why 'go fmt' allows you to add the 
function body (apparently of any length) on the same line as its 
declaration but doesn't allow a one line 'if' or 'for' statement even if 
the body consists of a single short statement.

So, if you write this:

if someCondition { break }

it always rewrites it as:

if someCondition {
    break
}

This means that you tend to need more lines to write your code in Go than 
you would in other C-family languages.

However, it's only a minor irritation and, as Dave said, a price worth 
paying for having a consistent coding style.

Don't get me started though on 8 space tabs :(

Alan

-- 
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