mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2024-11-16 19:33:47 +00:00
ch5-04 done
This commit is contained in:
parent
a5f8de6c94
commit
f7a06ecbb5
@ -79,7 +79,7 @@ bad.gopl.io
|
|||||||
log.SetPrefix("wait: ")
|
log.SetPrefix("wait: ")
|
||||||
log.SetFlags(0)
|
log.SetFlags(0)
|
||||||
```
|
```
|
||||||
第四種情況:有時,我們隻需要輸出錯誤信息就足夠了,不需要中斷程序的運行。我們可以通過log包提供函數
|
第四種策略:有時,我們隻需要輸出錯誤信息就足夠了,不需要中斷程序的運行。我們可以通過log包提供函數
|
||||||
```
|
```
|
||||||
if err := Ping(); err != nil {
|
if err := Ping(); err != nil {
|
||||||
log.Printf("ping failed: %v; networking disabled",err)
|
log.Printf("ping failed: %v; networking disabled",err)
|
||||||
|
Loading…
Reference in New Issue
Block a user