Explorar o código

Merge pull request #328 from htlhenry/patch-3

go关键字之后的匿名函数需要加上()
无闻 %!s(int64=9) %!d(string=hai) anos
pai
achega
78bf193df6
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      eBook/14.2.md

+ 1 - 1
eBook/14.2.md

@@ -281,7 +281,7 @@ ch := make(chan int)
 go func(){
 	// doSomething
 	ch <- 1 // Send a signal; value does not matter
-}
+}()
 doSomethingElseForAWhile()
 <- ch	// Wait for goroutine to finish; discard sent value.
 ```