pariz / gountries

Gountries provides: Countries (ISO-3166-1), Country Subdivisions(ISO-3166-2), Currencies (ISO 4217), Geo Coordinates(ISO-6709) as well as translations, country borders and other stuff exposed as struct data.
MIT License
408 stars 67 forks source link

List all countries #15

Closed nd2s closed 6 years ago

nd2s commented 6 years ago

Isn't there a way of getting a list of all countries?

pariz commented 6 years ago

Hi, @nd2s. There is.

query := gountries.New()

query.Countries // is a map[string]Country{}

However, i think i should add this as a struct method on Query because it feels it makes more sense. Something along the lines of query.FindAllCountries() which returns the same map[string]Country{}

I'll tag a new version this fix soon

nd2s commented 6 years ago

Thanks!