Struct in for loop initializer

Simplifying you code: for r := Request{}; r.err == nil; r.id++ { r.line, r.err = input.ReadSlice(0x0a) channel <- r } Gives compile time error: expected boolean or range expression, found simple statement (missing parentheses around composite literal?) (and 1 more errors) This construct is ambiguous to parse. The opening brace ‘{‘ is not obvious whether … Read more