fix: coding style and file format for chapter 11, 12, 13, 14 and 15.

This commit is contained in:
Bo-Yi Wu
2017-02-11 12:32:16 +08:00
parent c5413075c1
commit 4abbfabb52
63 changed files with 2662 additions and 2622 deletions

View File

@@ -1,19 +1,19 @@
// blocking.go
// throw: all goroutines are asleep - deadlock!
package main
import (
"fmt"
)
func f1(in chan int) {
fmt.Println(<-in)
}
func main() {
out := make(chan int)
//out := make(chan int, 1) // solution 2
// go f1(out) // solution 1
out <- 2
go f1(out)
}
// blocking.go
// throw: all goroutines are asleep - deadlock!
package main
import (
"fmt"
)
func f1(in chan int) {
fmt.Println(<-in)
}
func main() {
out := make(chan int)
//out := make(chan int, 1) // solution 2
// go f1(out) // solution 1
out <- 2
go f1(out)
}