() string { 3 return fmt.Sprintf("Sqrt:␣%v␣is␣nagative", float64 (*err)) 4 } 5 var err = SqrtError (3) 6 var x error = 1 // => type error 7 var y error = err // => type error 8 var z error = &err // => OK
SqrtError) Error () string { 3 return fmt.Sprintf("Sqrt:␣%v␣is␣nagative", float64(err)) 4 } 5 var err = SqrtError (3) 6 var x error = 1 // => type error 7 var y error = err // => OK 8 var z error = &err // => OK