This is a creation in Article, where the information may have evolved or changed.
2014 is ready to learn about go, after all, is Daniel Ken Tompson participate in the project, understand.
Bought a "Go Language Program Design", read the first chapter today, the 1.7 section of the concurrency is after all interested in
Features Summary:
1. In most cases no need to display the lock
2. Goroutine can have many
3.channel channel to pass data instead of shared data
Run a routine Polar2cartesian, the effect is good, but there is a problem has not been solved.
Input terminated to Ctrl + Z, but repeated testing can not exit the loop, only with Ctrl + C exit
Related code:
If runtime. GOOS = = "Windows" {
prompt = Fmt. Sprintf (prompt, "Ctrl + Z, Enter")
} else {
prompt = Fmt. Sprintf (Prompt, "ctrl+d")
}
It means that the Windows operating system uses CTRL + Z
Fmt. Printf ("Radius and Angle:")
Line, err: = Reader. ReadString (' \ n ')
If err! = Nil {
Break
}
This is the condition of exiting the loop, the practice proves that cannot exit successfully
Who knows why?
In addition, go 1.2 seems to be stable, much better than the go used two years ago. Oh, can continue to learn