func (g *Geocode) Location() (l Location) {
	l.Latitude = g.Latitude
	l.Longitude = g.Longitude
	l.Name = g.Name
	l.ShortName = g.Name
	return
}
Location converts a Geocode to a Location
package main
import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"strconv"
)
const mapAPI = "https://nominatim.openstreetmap.org/search"
type geoLocation struct {
	FormattedAddress string `json:"display_name"`
	Lat              string `json:"lat"`
	Lng              string `json:"lon"`
}
type geoResults []geoLocation
type Geocode struct {
	Name      string
	Latitude  float64
	Longitude float64
}
func Locate(location string) (l []Geocode, err error) {
	dlog.Printf("Locating %s", location)
	url := fmt.Sprintf("%s", mapAPI)
	params := map[string]string{"q": location, "format": "json", "addressDetails": "1"}
	var content []byte
	if content, err = get(url, params); err != nil {
		return
	}
	dlog.Printf("Gt results: %s", content)
	var r geoResults
	if err = json.Unmarshal(content, &r); err != nil {
		return
	}
	for _, res := range r {
		loc := &(res)
		var gc Geocode
		gc.Name = loc.FormattedAddress
		gc.Latitude, _ = strconv.ParseFloat(loc.Lat, 64)
		gc.Longitude, _ = strconv.ParseFloat(loc.Lng, 64)
		l = append(l, gc)
	}
	return
}