摘要:
package main import ( "fmt" "math" ) //自定义结构体错误,实现error接口 type InvaildradiusError struct { radius float64 Minradius float64 Maxreaius float64 } //封装工厂方法 func NewInvaildradi... 阅读全文
摘要:
package main import ( "errors" "fmt" "math" ) func GetToyBallvolume2 (redius float64)(volume float64,err error) { if redius 50 { err = errors.New("取值范围需要在[5,50]") ... 阅读全文