biter777 / countries

Countries - ISO-639, ISO-3166 countries codes with subdivisions and names, ISO-4217 currency designators, ITU-T E.164 IDD phone codes, countries capitals, UN M.49 codes, IANA ccTLD countries domains, FIPS, IOC/NOC and FIFA codes, VERY VERY FAST, compatible with Databases/JSON/BSON/GOB/XML/CSV, Emoji countries flags and currencies, Unicode CLDR.
https://pkg.go.dev/github.com/biter777/countries?tab=doc
BSD 2-Clause "Simplified" License
390 stars 74 forks source link

How to convert Alpha3 to Alpha2? #25

Closed m1d1 closed 3 years ago

m1d1 commented 3 years ago

Is there a way to convert ISO-3166-1 alpha3 country codes to alpha2? I.e. "AUT" to "AT".

I'm using the no longer maintained project

https://github.com/launchdarkly/go-country-codes

which has the GetByAlpha3() method, which I'm missing here.

Thanks.

m1d1 commented 3 years ago

I found that ByName() is taking the alpha3 as argument, thanks!

biter777 commented 3 years ago

U r welcome! :)