This is a MUCH simpler solution. I'm learning: package main
// AnnotationKey is used as a map key for particular AMQP maps. // It holds an interface{} which must be either a Symbol or a uint64 type AnnotationKey struct { value interface{} } type Symbol string func AnnotationKeySymbol(v Symbol) AnnotationKey { return AnnotationKey{v} } func AnnotationKeyULong(v uint64) AnnotationKey { return AnnotationKey{v} } func (ak AnnotationKey) Get() interface{} { return ak.value } func main() { k := AnnotationKeySymbol(Symbol("foo")) println(k.Get().(Symbol)) k = AnnotationKeyULong(42) println(k.Get().(uint64)) } -- 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.