()
| 11 | var arg = flag.Int("arg", 4, "An argument to send to the kite server.") |
| 12 | |
| 13 | func main() { |
| 14 | flag.Parse() |
| 15 | |
| 16 | // Create a kite. |
| 17 | k := kite.New("exp2", "1.0.0") |
| 18 | |
| 19 | // Connect to our math kite. |
| 20 | mathWorker := k.NewClient(math.Host.URL.String()) |
| 21 | err := mathWorker.Dial() |
| 22 | if err != nil { |
| 23 | panic(err) |
| 24 | } |
| 25 | |
| 26 | // Call square method with the given argument. |
| 27 | |
| 28 | response, err := mathWorker.Tell("square", &math.Request{ |
| 29 | Number: *arg, |
| 30 | Name: "math-cli", |
| 31 | }) |
| 32 | if err != nil { |
| 33 | panic(err) |
| 34 | } |
| 35 | |
| 36 | fmt.Println("result:", response.MustFloat64()) |
| 37 | } |
nothing calls this directly
no test coverage detected