I can give you a little bit of a start: I looked at the runtime recently,
and its representation is here
<https://github.com/golang/go/blob/8c1f21d9a2674dd9a410e0af94adf6fa7d2877d2/src/runtime/type.go#L28>.
It doesn't tell you how the creation/translation happens, but it tells you
how the low-level operations on it (like hashing, equality and conversions)
are implemented. It also links you to the linker
<https://github.com/golang/go/blob/8c1f21d9a2674dd9a410e0af94adf6fa7d2877d2/src/cmd/link/internal/ld/decodesym.go#L63>,
the compiler
<https://github.com/golang/go/blob/8c1f21d9a2674dd9a410e0af94adf6fa7d2877d2/src/cmd/compile/internal/gc/reflect.go#L842>
and
reflect
<https://github.com/golang/go/blob/8c1f21d9a2674dd9a410e0af94adf6fa7d2877d2/src/reflect/type.go#L297>.
>From there, you should be able to search for function calls and mentioned
types to build a picture.

On Tue, Jan 30, 2018 at 8:21 AM, Jason E. Aten <j.e.a...@gmail.com> wrote:

> I wrote some code to convert (go/types) types.Type to reflect.Type,
>
> but I kept thinking, "this has to be done somewhere already in
> the runtime or compiler libraries...", doesn't it?
>
> [ I know gc doesn't use go/types, but assume I'm asking about
> the equivalent (say /usr/local/go/src/cmd/compile/internal/syntax/nodes.go's
> TypeDecl)
> -- it has to be transformed at some
> point into a reflect.Type, right? ]
>
> Does anyone know where in the go codebase that transform lives?
>
> I'd just like to check and see if I've missed any important cases.
>
> Thank you!
>
> Jason
>
> --
> 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.
>

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