diff --git a/vendor/ch4-04/01/client/client b/vendor/ch4-04/01/client/client deleted file mode 100755 index 9dba6be..0000000 Binary files a/vendor/ch4-04/01/client/client and /dev/null differ diff --git a/vendor/ch4-04/01/client/client.go b/vendor/ch4-04/01/client/main.go similarity index 59% rename from vendor/ch4-04/01/client/client.go rename to vendor/ch4-04/01/client/main.go index a725a27..c603c40 100644 --- a/vendor/ch4-04/01/client/client.go +++ b/vendor/ch4-04/01/client/main.go @@ -1,11 +1,11 @@ package main import ( + hs "ch4-04/01/helloservice" + "context" + "fmt" "google.golang.org/grpc" "log" - "fmt" - ."github.com/advanced-go-programming-book-code/ch4/s04/e01grpc/helloservice" - "context" ) func main() { @@ -15,10 +15,10 @@ func main() { } defer conn.Close() - client := NewHelloServiceClient(conn) - reply, err := client.Hello(context.Background(), &String{Value: "hello"}) + client := hs.NewHelloServiceClient(conn) + reply, err := client.Hello(context.Background(), &hs.String{Value: "hello"}) if err != nil { log.Fatal(err) } fmt.Println(reply.GetValue()) -} \ No newline at end of file +} diff --git a/vendor/ch4-04/01/server/server.go b/vendor/ch4-04/01/server/main.go similarity index 55% rename from vendor/ch4-04/01/server/server.go rename to vendor/ch4-04/01/server/main.go index c82dddc..8618613 100644 --- a/vendor/ch4-04/01/server/server.go +++ b/vendor/ch4-04/01/server/main.go @@ -2,24 +2,26 @@ package main import ( "context" - "net" "log" - ."github.com/advanced-go-programming-book-code/ch4/s04/e01grpc/helloservice" + "net" + "google.golang.org/grpc" + + hs "ch4-04/01/helloservice" ) type HelloServiceImpl struct{} func (p *HelloServiceImpl) Hello( - ctx context.Context, args *String, -) (*String, error) { - reply := &String{Value: "hello:" + args.GetValue()} + ctx context.Context, args *hs.String, +) (*hs.String, error) { + reply := &hs.String{Value: "hello:" + args.GetValue()} return reply, nil } func main() { grpcServer := grpc.NewServer() - RegisterHelloServiceServer(grpcServer, new(HelloServiceImpl)) + hs.RegisterHelloServiceServer(grpcServer, new(HelloServiceImpl)) lis, err := net.Listen("tcp", ":1234") if err != nil { diff --git a/vendor/ch4-04/01/server/server b/vendor/ch4-04/01/server/server deleted file mode 100755 index 843bebb..0000000 Binary files a/vendor/ch4-04/01/server/server and /dev/null differ