创建管道时,使用 make(chan int,0)时,在第一个go命令执行时,调用协成,切因为管道为阻塞管道,在有接受命令式,发送命令都是阻塞的,所以第一个协程阻塞。第二个协程执行后,有发送命令执行。协程一中管道在接收到内容后,协程取消阻塞,继续执行。
2017-04-02
package main
import "fmt"
type Person struct {
Name string
Gender string
Age uint8
Address string
}
func (p *Person) Move(address string) string{
add := p.Address
p.Address = address
return add
}
import "fmt"
type Person struct {
Name string
Gender string
Age uint8
Address string
}
func (p *Person) Move(address string) string{
add := p.Address
p.Address = address
return add
}
2017-03-31
mm2["scala"], mm2["erlang"], mm2["python"] = 25, 50, 0
2017-03-27
浮点数 (3.700000E+01+5.980000E-02i) 表示的是 (37.000000+0.059800i)。
3.7E+1 + 5.98E-2i = 3.7* 10 + 5.98*0.01i
3.7E+1 + 5.98E-2i = 3.7* 10 + 5.98*0.01i
2017-03-19