This commit is contained in:
Bel LaPointe
2026-03-08 19:55:07 -06:00
parent b59276099c
commit bff0f4052c
3 changed files with 112 additions and 0 deletions

View File

@@ -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
}