Thank you very much, for your replies. I think noe I maybe understand the 
problem a lot better.
1. Yes I wanted to avoid type switches, escpacially in different modules.
2. "myType" ist a placeholder for a complext struct, and the comparison 
operators are only the basics. The goal are "contain" ans similar 
operations on these structs. And i would have prefered to provide only a 
carfully designed "less" operation and not repeating code.
3. Lessons learned: First i thought the "sort" package don't have this 
problem. But you are right: They avoided it. The only solution can be, not 
to define the operation ("less"), instead defining a metric for this 
operation (at the sort packege it is "len()"). So you can do everything 
with simple types and not with a placeholder which should be "compare" and 
"interface{}" at the same time.

I hope my conclusion is basicly right,
ty, c.

-- 
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