1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-24 12:32:21 +00:00

ch-1:06修正例子代码异常缩进

This commit is contained in:
wahaha 2018-06-15 18:15:00 +08:00 committed by GitHub
parent 224cd6bf5c
commit ff0aa76fc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -567,7 +567,7 @@ func main() {
func worker(cannel chan bool) {
for {
select {
default:
default:
fmt.Println("hello")
// 正常工作
case <-cannel:
@ -591,7 +591,7 @@ func main() {
func worker(cannel chan bool) {
for {
select {
default:
default:
fmt.Println("hello")
// 正常工作
case <-cannel:
@ -620,7 +620,7 @@ func worker(wg *sync.WaitGroup, cannel chan bool) {
for {
select {
default:
default:
fmt.Println("hello")
case <-cannel:
return
@ -863,10 +863,10 @@ func worker(ctx context.Context, wg *sync.WaitGroup) error {
for {
select {
default:
default:
fmt.Println("hello")
case <-ctx.Done():
return ctx.Err()
return ctx.Err()
}
}
}