MCPcopy
hub / github.com/grpc/grpc-go / printFeature

Function printFeature

examples/route_guide/client/client.go:48–57  ·  view source on GitHub ↗

printFeature gets the feature for the given point.

(client pb.RouteGuideClient, point *pb.Point)

Source from the content-addressed store, hash-verified

46
47// printFeature gets the feature for the given point.
48func printFeature(client pb.RouteGuideClient, point *pb.Point) {
49 log.Printf("Getting feature for point (%d, %d)", point.Latitude, point.Longitude)
50 ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
51 defer cancel()
52 feature, err := client.GetFeature(ctx, point)
53 if err != nil {
54 log.Fatalf("client.GetFeature failed: %v", err)
55 }
56 log.Println(feature)
57}
58
59// printFeatures lists all the features within the given bounding Rectangle.
60func printFeatures(client pb.RouteGuideClient, rect *pb.Rectangle) {

Callers 1

mainFunction · 0.85

Calls 4

PrintlnMethod · 0.80
PrintfMethod · 0.65
GetFeatureMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected