示例#1
0
func ExamplePoolNew() {
	p := pool.New(0)
	p.New = func() interface{} {
		return "World!"
	}
	fmt.Println(p.Get())
	// OutPut: World!
}
示例#2
0
func ExamplePool() {
	p := pool.New(0)
	p.Put("Hello")
	fmt.Println(p.Get())
	// OutPut: Hello
}