On Friday, 14 August 2020 13:00:19 UTC+2, xie cui wrote: > > the return instance of reflect.TypeOf(some object) should be generate by > compiler, the type info which could be in elf files. i want to known where > compiler generate it. >
Maybe this is the reason for your confusion. Your assumption that the compiler creates the value returned by reflect.TypeOf is _plain_ _wrong_. This is _not_ done during compile time as it cannot be during compile time. This happens during run time and thus _not_ by the compiler. You cannot know where the compiler generates it because the compiler doesn't generate it. The instance which is returned by reflect.TypeOf is generated by package reflect in the two lines https://golang.org/src/reflect/type.go#L1367 and 1368. V. -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/d8be4284-88c4-4bba-bca6-87aeae089e96o%40googlegroups.com.