func Mirrors(name string) (mirrors []string, err error) {
	client := &http.Client{Timeout: time.Second * 15}
	var wg sync.WaitGroup
	var mu sync.Mutex
	for _, mirror := range AllMirrors {
		wg.Add(1)
		go func(url string) {
			defer wg.Done()
			resp, err := client.Head(url)
			if err == nil {
				resp.Body.Close()
				if resp.StatusCode == 200 {
					mu.Lock()
					mirrors = append(mirrors, url)
					mu.Unlock()
				}
			}
		}(mirror + name)
	}
	wg.Wait()
	if len(mirrors) == 0 {
		return nil, errors.New("no mirrors found")
	}
	sort.Strings(mirrors)
	return mirrors, nil
}
Mirrors returns a list of OSM mirror urls that are hosting the planet file
for the provide name.
package osmfile
import (
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"os"
	"path/filepath"
	"sort"
	"strconv"
	"strings"
	"sync"
	"time"
)
var primary = "https://planet.openstreetmap.org/pbf/"
var AllMirrors = []string{
	"https://ftp.spline.de/pub/openstreetmap/pbf/",
	"https://ftp5.gwdg.de/pub/misc/openstreetmap/planet.openstreetmap.org/pbf/",
	"https://ftp.fau.de/osm-planet/pbf/",
	"https://free.nchc.org.tw/osm.planet/pbf/",
	"https://ftpmirror.your.org/pub/openstreetmap/pbf/",
	"https://download.bbbike.org/osm/planet/",
	"https://ftp.nluug.nl/maps/planet.openstreetmap.org/pbf/",
	"https://ftp.osuosl.org/pub/openstreetmap/pbf/",
	"https://planet.passportcontrol.net/pbf/",
	"https://planet.osm-hr.org/pbf/",
}
func Latest() (names []string, err error) {
	resp, err := http.Get(primary)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	if resp.StatusCode != 200 {
		return nil, errors.New(resp.Status)
	}
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}
	anchors := strings.Split(string(body), "<a ")
	for i := 1; i < len(anchors); i++ {
		if parts := strings.Split(anchors[i], `href="`); len(parts) > 1 {
			name := filepath.Base(strings.Split(parts[1], `"`)[0])
			if validBaseName(name) && name != "planet-latest.osm.pbf" {
				names = append(names, name)
			}
		}
	}
	if len(names) == 0 {
		return nil, errors.New("no names found")
	}
	sort.Slice(names, func(i, j int) bool {
		return names[i] > names[j]
	})
	return names, nil
}