From b11e5789fe11641eb3cd880ab87117e14abc9bf3 Mon Sep 17 00:00:00 2001 From: Asim Date: Sat, 2 Jan 2016 23:15:57 +0000 Subject: [PATCH] update client --- examples/service/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/service/main.go b/examples/service/main.go index d8f54e7c..fdefe922 100644 --- a/examples/service/main.go +++ b/examples/service/main.go @@ -5,7 +5,7 @@ import ( "os" "github.com/micro/cli" - micro "github.com/micro/go-micro" + "github.com/micro/go-micro" proto "github.com/micro/go-micro/examples/service/proto" "golang.org/x/net/context" ) @@ -24,7 +24,7 @@ func (g *Greeter) Hello(ctx context.Context, req *proto.HelloRequest, rsp *proto } // Setup and the client -func client(service micro.Service) { +func runClient(service micro.Service) { // Create new greeter client greeter := proto.NewGreeterClient("greeter", service.Client()) @@ -32,6 +32,7 @@ func client(service micro.Service) { rsp, err := greeter.Hello(context.TODO(), &proto.HelloRequest{Name: "John"}) if err != nil { fmt.Println(err) + return } // Print response @@ -65,7 +66,7 @@ func main() { // We could actually do this above micro.Action(func(c *cli.Context) { if c.Bool("client") { - client(service) + runClient(service) os.Exit(0) } }),