在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1、error接口的使用 示例: package main import "fmt" import "errors" func main() { //var err1 error = fmt.Errorf("%s", "this is normol err") err1 := fmt.Errorf("%s", "this is normal err1") fmt.Println("err1 = ", err1) err2 := errors.New("this is normal err2") fmt.Println("err2 = ", err2) } 执行结果: err1 = this is normal err1 err2 = this is normal err2
|
请发表评论