Error Handling
About
func convert() (float64, error) {
if a == '' {
return nil, errors.New("It failed")
}
return 10, nil
}Exit with panic
a, err = convert()
if err != nil {
panic(err)
}Last updated
func convert() (float64, error) {
if a == '' {
return nil, errors.New("It failed")
}
return 10, nil
}a, err = convert()
if err != nil {
panic(err)
}Last updated