color := colorFor(temperature) func colorFor(temperature int) string { if temperature > 100 { return "red" } return "blue" }
On Thursday, 16 August 2018 18:01:20 UTC+2, Haddock wrote: > > > var color >> if temperature > 100 { >> color = “red” >> } else { >> color = “blue” >> } >> > > IMHO, it could be argued about whether adding something like this would be > useful: > > color := if temperature > 100 { > return “red” > } else { > return “blue” > } > -- 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.