should mention that what you want can be achieved with composition using anonymous fields:
https://play.golang.org/p/vEKS70A-29 I know its not your original question, and this only works with `strcut` and `interface`, not build in types, like `int`. But it does give you the kind of behavior you were looking for. On Friday, January 20, 2017 at 2:59:08 AM UTC-5, Viktor Kojouharov wrote: > > Hello, > > Considering how easy it is to create new types based on underlying types, > how come the newly created ones do not delegate method calls to their > underlying types? Consider the following example: > > https://play.golang.org/p/Zs7Ve8ECk2 > > In the example, calling `b.num()` directly will not working, one will > have to manually do something like `Foo(b).num()` in order to invoke the > desired method. Why aren't these methods delegated automatically, similarly > to how they are delegated when dealing with embedded structs? > -- 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.