func GetCountryCode(name string) (string, *ServerError) {
	var country [1]country

	res, err := http.Get(RestCountriesRootPath + "/name/" + name + "?fullText=true&fields=name;alpha3Code")
	if err != nil {
		return "", &ServerError{"Get country failed with: " + err.Error(), res.StatusCode}
	}

	err = json.NewDecoder(res.Body).Decode(&country)
	if err != nil {
		return "", &ServerError{"Failed to decode json response from restcountries.eu", http.StatusInternalServerError}
	}
	res.Body.Close()

	return country[0].Alpha3Code, nil
}
// GetCountryCode gets the alpha 3 code of a given country.
GetCountryCode gets the alpha 3 code of a given country.
// GetCountryCode gets the alpha 3 code of a given country .
func GetCountryCode(name string) (string, *ServerError) {
	var country [1]country
	res, err := http.Get(RestCountriesRootPath + "/name/" + name + "?fullText=true&fields=name;alpha3Code")
	if err != nil {
		return "", &ServerError{"Get country failed with: " + err.Error(), res.StatusCode}
	}
	err = json.NewDecoder(res.Body).Decode(&country)
	if err != nil {
		return "", &ServerError{"Failed to decode json response from restcountries.eu", http.StatusInternalServerError}
	}
	res.Body.Close()
	return country[0].Alpha3Code, nil
}
func GetCountryCode ( name string ) ( string , * ServerError ) { var country [ 1 ] country res , err := http . Get ( RestCountriesRootPath + " " + name + " " ) if err != nil { return " " , & ServerError { " " + err . Error ( ) , res . StatusCode } } err = json . NewDecoder ( res . Body ) . Decode ( & country ) if err != nil { return " " , & ServerError { " " , http . StatusInternalServerError } } res . Body . Close ( ) return country [ 0 ] . Alpha3Code , nil }
GetCountryCode gets the alpha 3 code of a given country.
GetCountryCode gets the alpha 3 code of a given country .