On Fri, Jul 5, 2019 at 11:55 AM Malcolm Gorman <malcolm.gor...@gmail.com> wrote:
> If these single-statement if statements could be: > > if err != nil { return <any return arguments>, err } > > the visual appearance of code would become far more compact and easier to > read, and we wouldn't need any special new syntax. I prefer the opposite. I even add an empty line after the if-block when it ends in a return. if foo() { bar() } if baz() { return qux() } fmt.Prinln(42) Example in real and recent code: https://gitlab.com/cznic/gocc/blob/aef018deec791efc6b97da0f3369f6d7ca059aee/main.go#L230 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAA40n-VfYTPuHtA9WU%3DeoJ6b7TnbNqkwxOa7%2B8Y7asZTaEUncw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.