cmd/client/main.go (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
package main import ( "context" "fmt" "github.com/wbrijesh/trying-trpc/rpc/haberdasher" "net/http" "os" ) func main() { client := haberdasher.NewHaberdasherProtobufClient("http://localhost:8080", &http.Client{}) hat, err := client.MakeHat(context.Background(), &haberdasher.Size{Inches: 12}) if err != nil { fmt.Printf("oh no: %v", err) os.Exit(1) } fmt.Printf("I have a nice new hat: %+v", hat) } |