Re: [go-nuts] Re: Getting syntax-error on from assignment in if statements

2020-10-15 Thread Ariel Mashraki
Good to know that. Thanks for your response Ian. On Thursday, October 15, 2020 at 6:42:33 PM UTC+3 Ian Davis wrote: > On Thu, 15 Oct 2020, at 4:16 PM, Brian Candler wrote: > > It looks like a parsing ambiguity to me. The error suggests that the > open-brace is being treated as the start of th

Re: [go-nuts] Re: Getting syntax-error on from assignment in if statements

2020-10-15 Thread Ian Davis
On Thu, 15 Oct 2020, at 4:16 PM, Brian Candler wrote: > It looks like a parsing ambiguity to me. The error suggests that the > open-brace is being treated as the start of the body of the if-statement, i.e. > > if v := T { > }.F() > > Try changing it to > > if v == T{}.F(); v {} > > and you'll

[go-nuts] Re: Getting syntax-error on from assignment in if statements

2020-10-15 Thread Brian Candler
It looks like a parsing ambiguity to me. The error suggests that the open-brace is being treated as the start of the body of the if-statement, i.e. if v := T { }.F() Try changing it to if v == T{}.F(); v {} and you'll get a different error: "syntax error: unexpected . at end of statement"