1. 18.10 其他

如何在程序出错时终止程序:

if err != nil {
   fmt.Printf(“Program stopping with error %v”, err)
   os.Exit(1)
}

或者:

if err != nil { 
panic(“ERROR occurred: “ + err.Error())
}

1.1. 链接

Copyright © studygolang.com 2013 all right reserved,powered by Gitbook该文件修订时间: 2017-07-21 20:26:49

results matching ""

    No results matching ""