(r *Request)
| 509 | var ErrNegative = errors.New("negative argument") |
| 510 | |
| 511 | func Sqrt(r *Request) (interface{}, error) { |
| 512 | a := r.Args.One().MustFloat64() |
| 513 | |
| 514 | if a < 0 { |
| 515 | return nil, ErrNegative |
| 516 | } |
| 517 | |
| 518 | return math.Sqrt(a), nil |
| 519 | } |
| 520 | |
| 521 | // Calls the callback with the result. For testing requests with Callback. |
| 522 | func SquareCB(r *Request) (interface{}, error) { |
nothing calls this directly
no test coverage detected