On Friday, April 26, 2019 at 9:12:06 AM UTC+3, Mike Schinkel wrote: > > On Thursday, April 25, 2019 at 10:20:54 AM UTC-4, Sam Whited wrote: >> >> On Wed, Apr 24, 2019, at 14:08, Mark Volkmann wrote: >> > Are there really developers that find this unreadable? >> > >> > color := temperature > 80 ? “red” : “green” >> >> Yes. >> >> What is "?"? If I've never seen that before I have no easy way to search >> for that, and a random symbol me nothing about what it does. Go >> specifically tries to stick to keywords because even if you've never >> seen them before it's generally easier to figure out what they do (or to >> search for them if you're not sure). >> > > Given that, I am curious what your thoughts would be if this were possible > in Go instead? > > color := if temperature > 80 then “red” else “green” > > And especially if this formatting were valid: > > color := if temperature > 80 > then “red” > else “green” >
Hi, this is valid now: color := func() string { if temperature > 80 { return "red" } return "green" }() https://play.golang.org/p/U7Lc92mq315 -- 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.