草庐IT

IntCells

全部标签

Golang 接口(interface)方法链接

我有一个接口(interface)Cells有几个方法typeCellsinterface{Len()int//....}具体实现有StrCells、IntCells、FloatCells和BoolCells,它们都有上面的实现的方法。例如:typeStrCells[]stringfunc(sCStrCells)Len()int{returnlen(sC)}//...typeIntCells[]intfunc(iCIntCells)Len()int{returnlen(iC)}//...//....对于两种具体类型-IntCells和FloatCells-我想实现仅适用于这些类型的特定