vold
This commit is contained in:
34
cmd/main.go
34
cmd/main.go
@@ -2,9 +2,43 @@ package cmd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"googlemaps.github.io/maps"
|
||||
)
|
||||
|
||||
func Main(ctx context.Context) error {
|
||||
c, err := maps.NewClient(maps.WithAPIKey(os.Getenv("GOOGLE_PLACES_API_KEY")))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
resp, err := c.TextSearch(ctx, &maps.TextSearchRequest{
|
||||
Query: os.Args[1],
|
||||
Location: nil,
|
||||
Radius: uint(0),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return fmt.Errorf("%+v", resp)
|
||||
|
||||
/*
|
||||
resp, err := c.NearbySearch(ctx, &maps.NearbySearchRequest{
|
||||
Location: &maps.LatLng{},
|
||||
Radius: uint(0),
|
||||
Keyword: os.Args[1],
|
||||
Name: "",
|
||||
OpenNow: false,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v", resp)
|
||||
*/
|
||||
|
||||
return io.EOF
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user