From 9ccfd44724fe57a113fbaf57cd6240c2ca98e052 Mon Sep 17 00:00:00 2001 From: stephen mcquay Date: Sat, 20 Jan 2018 08:49:02 -0800 Subject: [PATCH] hwtc: host addr is required arg --- cmd/hwtc/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/hwtc/main.go b/cmd/hwtc/main.go index 526c9e8..d1b397a 100644 --- a/cmd/hwtc/main.go +++ b/cmd/hwtc/main.go @@ -10,17 +10,17 @@ import ( pb "mcquay.me/hwt/rpc/hwt" ) -const usage = "hwtc [subject]" +const usage = "hwtc [subject]" func main() { - if len(os.Args) < 2 { + if len(os.Args) < 3 { fmt.Fprintf(os.Stderr, "%v\n", usage) os.Exit(1) } - c := pb.NewHelloWorldProtobufClient("http://localhost:8080", &http.Client{}) + c := pb.NewHelloWorldProtobufClient(fmt.Sprintf("http://%s", os.Args[1]), &http.Client{}) - resp, err := c.Hello(context.Background(), &pb.HelloReq{Subject: strings.Join(os.Args[1:], " ")}) + resp, err := c.Hello(context.Background(), &pb.HelloReq{Subject: strings.Join(os.Args[2:], " ")}) if err != nil { fmt.Fprintf(os.Stderr, "hello: %v\n", err) os.Exit(1)