func requestGreet(s *gotalk.Sock, name string) string { r := "" if err := s.Request("greet", name, &r); err != nil { panic("request error: " + err.Error()) } return r }
func onAccept(s *gotalk.Sock) { s.Notify("hello", "world") go func() { // Send a request & read result via JSON-encoded go values. greeting := GreetOut{} if err := s.Request("greet", GreetIn{"Rasmus"}, &greeting); err != nil { fmt.Printf("greet request failed: " + err.Error()) } else { fmt.Printf("greet: %+v\n", greeting) } }() }