编译后的代码实际上有两份。一个是给 Float 准备的, 一个是给int准备的,有个疑问是传入的是两个参数,一个是栈上的数据,一个是静态数据,静态数据用于在里面给interface初始化用。
可能是这样的。
为什么要搞个 .dic.func ?? 不麻烦吗? 如果内置的数据一样呢,struct 数据呢?
内置数据一样的情况:
type mytype int
var a mytype = 1
Printkk(a)
如果underlying的数据结构是一样的,调用同样的函数。 type 传入不同的参数。
struct 数据呢?
type structtype1 struct{
A int
B int
}
type structtype2 struct{
C int
D int
}