global-countries-gosdk

A Golang implementation of global-countries

Installation

go get github.com/GoodnessEzeokafor/global-countries-go

// get all countries
data:= countries.Countries()	
fmt.Println(data)

// get call codes
country := "iraq"
capital, err := countries.GetCountryCallCode(country)
if err != nil {
  fmt.Println(err)
}
fmt.Println(capital)

// get flag
country := "iraq"
capital, err := countries.GetCountryFlag(country)
if err != nil {
  fmt.Println(err)
}
fmt.Println(capital)

// get iso codes - Alpha-2 code/ Alpha-3 code
country := "zambia"
capital, err := countries.GetCountryIsoCodes(country)
if err != nil {
  fmt.Println(err)
}
fmt.Println(capital)

// get capital
country := "nigeria"
capital, err := countries.GetCountryCapital(country)
if err != nil {
  fmt.Println(err)
}
fmt.Println(capital)

GitHub

https://github.com/GoodnessEzeokafor/global-countries-go