You may try to use `go tool compile -S <filename>` and read the assemble codes to find the truth.
On Wednesday, July 29, 2020 at 5:39:53 AM UTC+8 shan...@gmail.com wrote: > Hi all, I'm trying to understand what *exactly* the .(type) is doing in > the following statement > > switch foo := bar.(type) > > I mean, I get that foo is being assigned a type converted version of the > bar interface, but, I want to see what exactly they .(type) call does. > > I have found > https://github.com/golang/go/blob/master/src/go/types/selection.go#L60 > which I *think* is the method being called, but I am not sure. > > So I have two questions. > 1) Am I looking at the correct function > 2) (and far more importantly) How do I find which method such code is > calling (it's problematic for me at this point towork out what, for > example, something defined in builtin is really calling. > > Can someone point me at a resource that I have obviously overlooked? > > > Note: I've seen this > https://stackoverflow.com/questions/18512781/built-in-source-code-location > and, rereading it this morning it looks like "If it's not in the runtime > package, start grepping the compiler packages" - is that what I should be > doing? > -- 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/6a813c48-cacd-4916-9116-e21bcf5b7b4bn%40googlegroups.com.