https://github.com/iftekhersunny/go_country
Country is the package that helps you to get country name and dialling code by the country ISO 3166-1 Alpha-2 code.
https://github.com/iftekhersunny/go_country
country country-codes country-names go golang
Last synced: 4 months ago
JSON representation
Country is the package that helps you to get country name and dialling code by the country ISO 3166-1 Alpha-2 code.
- Host: GitHub
- URL: https://github.com/iftekhersunny/go_country
- Owner: IftekherSunny
- License: mit
- Created: 2017-05-14T04:51:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-31T05:05:53.000Z (almost 8 years ago)
- Last Synced: 2024-06-21T03:10:54.649Z (over 1 year ago)
- Topics: country, country-codes, country-names, go, golang
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 14
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### Country
[](https://github.com/IftekherSunny/go_country/releases)
[](https://travis-ci.org/IftekherSunny/go_country)
[](https://cover.run/go/github.com/IftekherSunny/go_country)
[](https://goreportcard.com/report/github.com/IftekherSunny/go_country)
[](https://godoc.org/github.com/IftekherSunny/go_country)
[](https://github.com/IftekherSunny/go_country/blob/master/LICENSE)Country is the package that helps you to get country name and dialing code by the country ISO 3166-1 Alpha-2 code.
### Installation Process
```
go get github.com/IftekherSunny/go_country
```### Basic Uses
##### Get all countries name and dialing code
```go
country := country.NewCountry()countries := country.All()
```##### Get a country name and dialing code
```go
country := country.NewCountry()countryDetails, _ := country.Get("BD")
```##### Get multiple countries name and dialing code
```go
country := country.NewCountry()countries, _ := country.Get([]string{"BD", "US"})
```##### Get a country name
```go
country := country.NewCountry()name, _ := country.GetName("BD")
```##### Get a country dialing code
```go
country := country.NewCountry()dialingCode, _ := country.GetDialingCode("BD")
```### Test
##### Run tests
```
go test -v
```### License
This package is licensed under the [MIT License](https://github.com/iftekhersunny/country-for-golang/blob/master/LICENSE)