Indi
ZingLix Blog zinglix.xyz

问题描述 在使用 Go 的泛型时,如果泛型类型存在 constraint,而传入的类型在实现这个 constraint 时使用的是 pointer receiver,那么就会遇到 XXX does not satisfy XXX (method XXX has pointer receiver) 的报错,就比如下面这个例子希望用 Create 函数完成所有创建 Person 的操作 1 2 3 4…

讨论

还没有评论,来说第一句吧。

ZingLix Blog 的其他文章