2013-06-27 50 views

回答

6

例如,

package main 

import "fmt" 

func main() { 
    a := make(chan bool, 5) 
    a <- true 
    fmt.Println(cap(a) - len(a)) 
} 

輸出:

4