gocore: add function to find the dynamic type of an interface

Typically you could also get this type from following the data
pointer of the interface. But the direct vs indirect distinction
means you can't distinguish between *T and T, and for typed nils
there's no way to find the type.

Instead, just provide this functionality directly.

Change-Id: I70d1a613b815c4ffe93dea9ada73c0b065907b78
Reviewed-on: https://go-review.googlesource.com/92415
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
2 files changed