odsh97,

More than a million Go programmers agree with you that format and
readability is everything.
We have a standard tool, go fmt, to ensure it. All Go code conforms. You'll
like the uniformity.

Michael

On Sat, Sep 8, 2018 at 7:50 AM alanfo <alan.f...@gmail.com> wrote:

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


-- 

*Michael T. jonesmichael.jo...@gmail.com <michael.jo...@gmail.com>*

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