go-pattern-examples/creation/04_object_pool/obejct_poo.go
2020-05-02 17:36:50 +08:00

24 lines
263 B
Go

package objectpool
type doctor struct {
name string
kind int //科室
}
type pool chan *doctor
func newPool(total int) pool {
p := make(pool, total)
for i := 0; i < total; i++ {
p <- new(doctor)
}
return p
}
//surgery
func (d doctor) surgery() {
}