goong.io API wrappers for Golang
- Places
- Geocoding
- Directions
Important: This key should be kept secret on your server.
To install the Go Client for Goong API, please execute the following go get
command.
go get github.com/laofun/go-goong
View the reference documentation for for API information.
- Go 1.14 or later.
- A Goong API key.
package main
import (
"log"
"context"
"github.com/kr/pretty"
"github.com/laofun/go-goong"
"github.com/laofun/go-goong/lib/places"
)
func main() {
client, err := goong.NewClient("Insert-API-Key-Here")
if err != nil {
log.Fatalf("fatal error: %s", err)
}
r := &places.AutoCompleteOpts{
Input: "quan 1",
}
resp, err := client.Places.Autocomplete(context.Background(),r)
if err != nil {
log.Fatalf("fatal error: %s", err)
}
pretty.Println(resp)
}