1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-01-05 10:20:53 +02:00
go-micro/examples/noproto/client/main.go
Asim Aslam d94936f6c9
v3 (#2104)
* v3

* revert plugins

* fixup some issues
2021-01-20 13:54:31 +00:00

25 lines
450 B
Go

package main
import (
"context"
"fmt"
"github.com/asim/go-micro/v3"
"github.com/asim/go-micro/v3/client"
)
func main() {
service := micro.NewService()
service.Init()
c := service.Client()
request := c.NewRequest("greeter", "Greeter.Hello", "john", client.WithContentType("application/json"))
var response string
if err := c.Call(context.TODO(), request, &response); err != nil {
fmt.Println(err)
return
}
fmt.Println(response)
}