//
pkg.gl
Category
github.com/ct-zh/goLearn
doc
01basic
08generics
generics
package
0.0.0-20240627085529-3c531c578999
Repository:
https://github.com/ct-zh/golearn.git
Documentation:
pkg.go.dev
Overview
Versions
1
Dependencies
0
Dependents
0
Files
21 SLOC
#
Functions
Add
Add 泛型版本 函数测试 执行 go test -v --run=TestAdd .
AddFloat
No description provided by the author
AddInt
No description provided by the author
AddUint32
No description provided by the author
#
Structs
MyList
MyList 在该结构体中,类型T的真实类型为接口Comparable声明的类型.
#
Interfaces
Comparable
Comparable go语言的泛型是基于合约的泛型。 Go语言中的合约称为“类型约束”。类型约束可以用于定义类型参数的约束 声明方法如下.