funcmain(){initSampleData()lis,err:=net.Listen("tcp",port)iferr!=nil{log.Fatalf("failed to isten: %v",err)}s:=grpc.NewServer(grpc.UnaryInterceptor(orderUnaryServerInterceptor))ordermgt_pb.RegisterOrderManagementServer(s,&orderMgtServer{})user_pb.RegisterUserManagementServer(s,&userMgtServer{})iferr:=s.Serve(lis);err!=nil{log.Fatalf("failed to serve: %v",err)}}
funcmain(){conn,err:=grpc.Dial(address,grpc.WithInsecure(),grpc.WithBlock())iferr!=nil{log.Fatalf("did not connect: %v",err)}deferconn.Close()client:=pb.NewOrderManagementClient(conn)ctx,cancel:=context.WithTimeout(context.Background(),time.Second*5)defercancel()heclien:=hwpb.NewGreetingClient(conn)}