Re: [go-nuts] Re: Go if else syntax .. suggested replacement

2019-04-24 Thread David Koblas
IMHO I've wanted a switch expression, rather than a switch statement for a while. value := switch test { case true => "red" case false => "blue" } or value := switch item.(type) { case int => item case string => strconv.Atoi(item) case time.Time => {     ... something more involved .

[go-nuts] Trying to dynamically find interfaces

2016-06-27 Thread David Koblas
I've got a program that is trying to implement functions on "subclasses", where the parent can check to see if the interface is implemented. For perspective, it's really dealing with REST URL generation based on if methods exist. What I'm running into is that based on the following pattern, bot