1package ipinfo 2 3// GetCountryName gets the full name of a country from its code, e.g. 4// "PK" -> "Pakistan". 5func GetCountryName(country string) string { 6 return countriesMap[country] 7} 8 9var countriesMap = map[string]string{ 10 "BD": "Bangladesh", 11 "BE": "Belgium", 12 "BF": "Burkina Faso", 13 "BG": "Bulgaria", 14 "BA": "Bosnia and Herzegovina", 15 "BB": "Barbados", 16 "WF": "Wallis and Futuna", 17 "BL": "Saint Barthelemy", 18 "BM": "Bermuda", 19 "BN": "Brunei", 20 "BO": "Bolivia", 21 "BH": "Bahrain", 22 "BI": "Burundi", 23 "BJ": "Benin", 24 "BT": "Bhutan", 25 "JM": "Jamaica", 26 "BV": "Bouvet Island", 27 "BW": "Botswana", 28 "WS": "Samoa", 29 "BQ": "Bonaire, Saint Eustatius and Saba ", 30 "BR": "Brazil", 31 "BS": "Bahamas", 32 "JE": "Jersey", 33 "BY": "Belarus", 34 "BZ": "Belize", 35 "RU": "Russia", 36 "RW": "Rwanda", 37 "RS": "Serbia", 38 "TL": "East Timor", 39 "RE": "Reunion", 40 "TM": "Turkmenistan", 41 "TJ": "Tajikistan", 42 "RO": "Romania", 43 "TK": "Tokelau", 44 "GW": "Guinea-Bissau", 45 "GU": "Guam", 46 "GT": "Guatemala", 47 "GS": "South Georgia and the South Sandwich Islands", 48 "GR": "Greece", 49 "GQ": "Equatorial Guinea", 50 "GP": "Guadeloupe", 51 "JP": "Japan", 52 "GY": "Guyana", 53 "GG": "Guernsey", 54 "GF": "French Guiana", 55 "GE": "Georgia", 56 "GD": "Grenada", 57 "GB": "United Kingdom", 58 "GA": "Gabon", 59 "SV": "El Salvador", 60 "GN": "Guinea", 61 "GM": "Gambia", 62 "GL": "Greenland", 63 "GI": "Gibraltar", 64 "GH": "Ghana", 65 "OM": "Oman", 66 "TN": "Tunisia", 67 "JO": "Jordan", 68 "HR": "Croatia", 69 "HT": "Haiti", 70 "HU": "Hungary", 71 "HK": "Hong Kong", 72 "HN": "Honduras", 73 "HM": "Heard Island and McDonald Islands", 74 "VE": "Venezuela", 75 "PR": "Puerto Rico", 76 "PS": "Palestinian Territory", 77 "PW": "Palau", 78 "PT": "Portugal", 79 "SJ": "Svalbard and Jan Mayen", 80 "PY": "Paraguay", 81 "IQ": "Iraq", 82 "PA": "Panama", 83 "PF": "French Polynesia", 84 "PG": "Papua New Guinea", 85 "PE": "Peru", 86 "PK": "Pakistan", 87 "PH": "Philippines", 88 "PN": "Pitcairn", 89 "PL": "Poland", 90 "PM": "Saint Pierre and Miquelon", 91 "ZM": "Zambia", 92 "EH": "Western Sahara", 93 "EE": "Estonia", 94 "EG": "Egypt", 95 "ZA": "South Africa", 96 "EC": "Ecuador", 97 "IT": "Italy", 98 "VN": "Vietnam", 99 "SB": "Solomon Islands", 100 "ET": "Ethiopia", 101 "SO": "Somalia", 102 "ZW": "Zimbabwe", 103 "SA": "Saudi Arabia", 104 "ES": "Spain", 105 "ER": "Eritrea", 106 "ME": "Montenegro", 107 "MD": "Moldova", 108 "MG": "Madagascar", 109 "MF": "Saint Martin", 110 "MA": "Morocco", 111 "MC": "Monaco", 112 "UZ": "Uzbekistan", 113 "MM": "Myanmar", 114 "ML": "Mali", 115 "MO": "Macao", 116 "MN": "Mongolia", 117 "MH": "Marshall Islands", 118 "MK": "Macedonia", 119 "MU": "Mauritius", 120 "MT": "Malta", 121 "MW": "Malawi", 122 "MV": "Maldives", 123 "MQ": "Martinique", 124 "MP": "Northern Mariana Islands", 125 "MS": "Montserrat", 126 "MR": "Mauritania", 127 "IM": "Isle of Man", 128 "UG": "Uganda", 129 "TZ": "Tanzania", 130 "MY": "Malaysia", 131 "MX": "Mexico", 132 "IL": "Israel", 133 "FR": "France", 134 "IO": "British Indian Ocean Territory", 135 "SH": "Saint Helena", 136 "FI": "Finland", 137 "FJ": "Fiji", 138 "FK": "Falkland Islands", 139 "FM": "Micronesia", 140 "FO": "Faroe Islands", 141 "NI": "Nicaragua", 142 "NL": "Netherlands", 143 "NO": "Norway", 144 "NA": "Namibia", 145 "VU": "Vanuatu", 146 "NC": "New Caledonia", 147 "NE": "Niger", 148 "NF": "Norfolk Island", 149 "NG": "Nigeria", 150 "NZ": "New Zealand", 151 "NP": "Nepal", 152 "NR": "Nauru", 153 "NU": "Niue", 154 "CK": "Cook Islands", 155 "XK": "Kosovo", 156 "CI": "Ivory Coast", 157 "CH": "Switzerland", 158 "CO": "Colombia", 159 "CN": "China", 160 "CM": "Cameroon", 161 "CL": "Chile", 162 "CC": "Cocos Islands", 163 "CA": "Canada", 164 "CG": "Republic of the Congo", 165 "CF": "Central African Republic", 166 "CD": "Democratic Republic of the Congo", 167 "CZ": "Czech Republic", 168 "CY": "Cyprus", 169 "CX": "Christmas Island", 170 "CR": "Costa Rica", 171 "CW": "Curacao", 172 "CV": "Cape Verde", 173 "CU": "Cuba", 174 "SZ": "Swaziland", 175 "SY": "Syria", 176 "SX": "Sint Maarten", 177 "KG": "Kyrgyzstan", 178 "KE": "Kenya", 179 "SS": "South Sudan", 180 "SR": "Suriname", 181 "KI": "Kiribati", 182 "KH": "Cambodia", 183 "KN": "Saint Kitts and Nevis", 184 "KM": "Comoros", 185 "ST": "Sao Tome and Principe", 186 "SK": "Slovakia", 187 "KR": "South Korea", 188 "SI": "Slovenia", 189 "KP": "North Korea", 190 "KW": "Kuwait", 191 "SN": "Senegal", 192 "SM": "San Marino", 193 "SL": "Sierra Leone", 194 "SC": "Seychelles", 195 "KZ": "Kazakhstan", 196 "KY": "Cayman Islands", 197 "SG": "Singapore", 198 "SE": "Sweden", 199 "SD": "Sudan", 200 "DO": "Dominican Republic", 201 "DM": "Dominica", 202 "DJ": "Djibouti", 203 "DK": "Denmark", 204 "VG": "British Virgin Islands", 205 "DE": "Germany", 206 "YE": "Yemen", 207 "DZ": "Algeria", 208 "US": "United States", 209 "UY": "Uruguay", 210 "YT": "Mayotte", 211 "UM": "United States Minor Outlying Islands", 212 "LB": "Lebanon", 213 "LC": "Saint Lucia", 214 "LA": "Laos", 215 "TV": "Tuvalu", 216 "TW": "Taiwan", 217 "TT": "Trinidad and Tobago", 218 "TR": "Turkey", 219 "LK": "Sri Lanka", 220 "LI": "Liechtenstein", 221 "LV": "Latvia", 222 "TO": "Tonga", 223 "LT": "Lithuania", 224 "LU": "Luxembourg", 225 "LR": "Liberia", 226 "LS": "Lesotho", 227 "TH": "Thailand", 228 "TF": "French Southern Territories", 229 "TG": "Togo", 230 "TD": "Chad", 231 "TC": "Turks and Caicos Islands", 232 "LY": "Libya", 233 "VA": "Vatican", 234 "VC": "Saint Vincent and the Grenadines", 235 "AE": "United Arab Emirates", 236 "AD": "Andorra", 237 "AG": "Antigua and Barbuda", 238 "AF": "Afghanistan", 239 "AI": "Anguilla", 240 "VI": "U.S. Virgin Islands", 241 "IS": "Iceland", 242 "IR": "Iran", 243 "AM": "Armenia", 244 "AL": "Albania", 245 "AO": "Angola", 246 "AQ": "Antarctica", 247 "AS": "American Samoa", 248 "AR": "Argentina", 249 "AU": "Australia", 250 "AT": "Austria", 251 "AW": "Aruba", 252 "IN": "India", 253 "AX": "Aland Islands", 254 "AZ": "Azerbaijan", 255 "IE": "Ireland", 256 "ID": "Indonesia", 257 "UA": "Ukraine", 258 "QA": "Qatar", 259 "MZ": "Mozambique", 260} 261