英文:
Where did golang implementation about builtin function
问题
例如,如果我通过调用print()
来打印一个接口,然后它会调用printiface()
,我想知道这两个语句之间实际上发生了什么。
英文:
For example, if I'm printing an interface by calling print()
, and then, It will call printiface()
, I'm wondering what does go actually between these two statements.
答案1
得分: 2
根据我所了解的情况,print
调用在编译时会转换为printstring
、printiface
等等。如果你想查看print
代码是如何生成的,你可能会对src/cmd/gc/walk.c
中的这段代码感兴趣。
英文:
From what I could gather, print
calls turn into printstring
, printiface
, etc. at compile time. If you want to look at how print
code is generated, you could be interested in this code in src/cmd/gc/walk.c
.
答案2
得分: 1
printiface()
方法主要被ifaceI2T()
、ifaceI2I()
、ifaceeq()
和printinter()
调用。你可以在runtime/iface.c
中找到更多相关信息。
英文:
That method printiface()
is mainly called by ifaceI2T()
, ifaceI2I()
, ifaceeq()
, printinter()
.
So you can see more in runtime/iface.c
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论