(r *kite.Request)
| 51 | } |
| 52 | |
| 53 | func Square(r *kite.Request) (interface{}, error) { |
| 54 | // Unmarshal method arguments |
| 55 | a := r.Args.One().MustFloat64() |
| 56 | |
| 57 | result := a * a |
| 58 | |
| 59 | fmt.Printf("Call received, sending result %.0f back\n", result) |
| 60 | |
| 61 | // Print a log on remote Kite. |
| 62 | // This message will be printed on client's console. |
| 63 | r.Client.Go("kite.log", fmt.Sprintf("Message from %s: \"You have requested square of %.0f\"", r.LocalKite.Kite().Name, a)) |
| 64 | |
| 65 | // You can return anything as result, as long as it is JSON marshalable. |
| 66 | return result, nil |
| 67 | } |
nothing calls this directly
no test coverage detected