草庐IT

TableAbstruct

全部标签

go - 结构片不能插入golang中的接口(interface)片

这个问题在这里已经有了答案:sliceofstruct!=sliceofinterfaceitimplements?(6个答案)关闭4年前。我有Tag结构和TableAbstruct接口(interface),如下例所示。[标签结构]typeTagstruct{Idint`db:"id"`Namestring`db:"Name"`}func(tagTag)Serialize()[]string{...}[TableAbstruct接口(interface)]typeTableAbstructinterface{Serialize()[]string}Xxx()函数返回[]TableAb