https://cloud.tencent.com/developer/article/2037535 Go 语言怎么优化重复的 if err != nil 样板代码?
func CheckErrors (err error) {
if err != nil {
return err
}
}
err := SomeMethod()
CheckErrors(err)
https://cloud.tencent.com/developer/article/2037535 Go 语言怎么优化重复的 if err != nil 样板代码?
func CheckErrors (err error) {
if err != nil {
return err
}
}
err := SomeMethod()
CheckErrors(err)