Re: [go-nuts] Inconsistency in gofmt

2017-12-12 Thread Jesse McNelis
On Wed, Dec 13, 2017 at 11:01 AM, Pablo Rozas Larraondo wrote: > Hello, > > I'm curious to know if this is intended: > > https://play.golang.org/p/t353t8ZvL1 This is intentional. gofmt uses spacing to group expressions based on precedence of operators. eg. (i+2)/2 + 1 //In this line it's clear t

[go-nuts] Inconsistency in gofmt

2017-12-12 Thread Pablo Rozas Larraondo
Hello, I'm curious to know if this is intended: https://play.golang.org/p/t353t8ZvL1 Line 9 is formatted with spaces but line 10 has no spaces. It seems like adding +1 to the expression changes the behaviour of "gofmt". Wouldn't it be simpler for "gofmt" to always add spaces between the operator