I suspect this is due to escape analysis. In your first tests, the
compiler can see that the second parameter doesn't escape so it can
create an interface{} boxing of 42 on the heap. When calling a method
on an interface it can't see that, so it needs to heap allocate the
interface{} for 42.
You can see this if you compile with "-gcflags -m".
//jb
> --
> 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...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.