Re: [go-nuts] multiple-line 'expression' of if-statement not supported?

2020-06-11 Thread xiangdong...@gmail.com
Thanks a lot, Ian, it works now. On Thursday, June 11, 2020 at 2:17:23 PM UTC+8, Ian Lance Taylor wrote: > > On Wed, Jun 10, 2020 at 11:05 PM xiang...@gmail.com > > wrote: > > > > Wondering if the 'expression' part of an if-statement should be in one > line only, given the following case,

Re: [go-nuts] multiple-line 'expression' of if-statement not supported?

2020-06-11 Thread Ian Lance Taylor
On Wed, Jun 10, 2020 at 11:05 PM xiangdong...@gmail.com wrote: > > Wondering if the 'expression' part of an if-statement should be in one line > only, given the following case, 'go tool compile' will report a syntax error > > Enter code here... > package p > > func cf1() int { > return 0

[go-nuts] multiple-line 'expression' of if-statement not supported?

2020-06-11 Thread xiangdong...@gmail.com
Hi all, Wondering if the 'expression' part of an if-statement should be in one line only, given the following case, 'go tool compile' will report a syntax error Enter code here... package p func cf1() int { return 0 } func cf2() int { return 10 } func f() { *if cf2()