mirror of
https://codeberg.org/andyscott/OpenWeather-gRPC-API.git
synced 2024-11-09 06:00:49 -05:00
20 lines
357 B
Go
20 lines
357 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"log"
|
||
|
|
||
|
pb "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto"
|
||
|
)
|
||
|
|
||
|
func doLocation(c pb.WeatherServiceClient) {
|
||
|
|
||
|
res, err := c.Location(context.Background(), &pb.RequestLocation{
|
||
|
City: "Corvallis",
|
||
|
})
|
||
|
if err != nil {
|
||
|
log.Fatalln(err)
|
||
|
}
|
||
|
log.Printf("Latitude: %v, Longitude: %v\n", res.Latitude, res.Longitude)
|
||
|
}
|