在 2018年8月15日星期三 UTC+8上午12:43:37,Mark Volkmann写道:

> var color = temperature > 100 ? “red” : “blue”  

 
Although this feature will not be accepted, we could just talk about it. I 
prefer 'if-expression'  to ternary.

var color = if temperature > 100 { "red" } else { "blue" }

vs. current if statement syntax:

var color 
if temperature > 100 {
    color = "red"
} else {
    color = "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.

Reply via email to