Update 'README.md'

This commit is contained in:
Andrew Scott 2022-09-08 04:10:13 +02:00
parent f3e9194a98
commit 2156908022

View file

@ -84,21 +84,19 @@ In this case, we're requesting the current weather for Corvallis, OR.
``` ```
func doCurrent(c pb.WeatherServiceClient) { func doCurrent(c pb.WeatherServiceClient) {
res, err := c.Current(context.Background(), &pb.RequestCurrent{
res, err := c.Current(context.Background(), &pb.RequestCurrent{ LocationType: pb.LocationType_LOCATION_TYPE_CITY,
LocationType: pb.LocationType_LOCATION_TYPE_CITY, Units: pb.Units_UNITS_METRIC,
Units: pb.Units_UNITS_METRIC, Location: &pb.OneOfLocation{
Location: &pb.OneOfLocation{ LocationId: &pb.OneOfLocation_City{
LocationId: &pb.OneOfLocation_City{ City: "Corvallis",
City: "Corvallis", },
}, },
}, })
}) if err != nil {
if err != nil { log.Fatalln(err)
log.Fatalln(err) }
} log.Println(res.Payload)
log.Println(res.Payload)
} }
``` ```