7 Aug 2012 21:38
Curious oddity with gofmt
Hi,
I've been recently editing some go code, passing it thru gofmt and I
noticed an oddity. For example, code:
func main() {
a := make([]byte, 16)
b := len(a) - 1
c := somefunc(1, 2, len(a)-1)
d := sometype{1, 2, len(a) - 1}
}
Why is it that go *removes* spaces around minus operator in a function
call, yet it *adds* spaces when same minus operator is used within a
struct literal or a variable expression? It strikes me odd, because
it's extremely sore and unintuitive.
Best regards,
Alexey.
RSS Feed