@@ -28,7 +28,7 @@ import (
2828 "google.golang.org/grpc"
2929 "google.golang.org/grpc/credentials/insecure"
3030 _ "google.golang.org/grpc/examples/features/customloadbalancer/client/customroundrobin" // To register custom_round_robin.
31- "google.golang.org/grpc/examples/features/proto/echo"
31+ pb "google.golang.org/grpc/examples/features/proto/echo"
3232 "google.golang.org/grpc/internal"
3333 "google.golang.org/grpc/peer"
3434 "google.golang.org/grpc/resolver"
@@ -64,7 +64,7 @@ func main() {
6464 }
6565 ctx , cancel := context .WithTimeout (context .Background (), time .Second * 10 )
6666 defer cancel ()
67- ec := echo .NewEchoClient (cc )
67+ ec := pb .NewEchoClient (cc )
6868 if err := waitForDistribution (ctx , ec ); err != nil {
6969 log .Fatalf (err .Error ())
7070 }
@@ -74,7 +74,7 @@ func main() {
7474// waitForDistribution makes RPC's on the echo client until 3 RPC's follow the
7575// same 1:2 address ratio for the peer. Returns an error if fails to do so
7676// before context timeout.
77- func waitForDistribution (ctx context.Context , ec echo .EchoClient ) error {
77+ func waitForDistribution (ctx context.Context , ec pb .EchoClient ) error {
7878 for {
7979 results := make (map [string ]uint32 )
8080 InnerLoop:
@@ -87,7 +87,7 @@ func waitForDistribution(ctx context.Context, ec echo.EchoClient) error {
8787 res := make (map [string ]uint32 )
8888 for j := 0 ; j < 3 ; j ++ {
8989 var peer peer.Peer
90- r , err := ec .UnaryEcho (ctx , & echo .EchoRequest {Message : "this is examples/customloadbalancing" }, grpc .Peer (& peer ))
90+ r , err := ec .UnaryEcho (ctx , & pb .EchoRequest {Message : "this is examples/customloadbalancing" }, grpc .Peer (& peer ))
9191 if err != nil {
9292 return fmt .Errorf ("UnaryEcho failed: %v" , err )
9393 }
0 commit comments