Regarding your issues with the following... > I've lost count of the times I've had to change: > > return FooBar{ > Field: blah, > } > > To: > > var foo FooBar > if someCond { > foo.Field = blah > } else { > foo.Field = bar > } > return foo >
...I hardly consider that to be idiomatic Go. A more go-like approach would be to follow the guideline to "return early" and write it more like this: if someCond { return FooBar{Field: blah} } return FooBar{Field: bar} ...which (IMHO) is markedly more readable than a ternary expression. -- 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. For more options, visit https://groups.google.com/d/optout.