diff --git a/.generator/package.json b/.generator/package.json index 0e4c2bf..fadeb73 100644 --- a/.generator/package.json +++ b/.generator/package.json @@ -1,4 +1,7 @@ { + "scripts": { + "generate": "node app.js" + }, "dependencies": { "glob": "^7.1.6", "glob-promise": "^4.1.0", diff --git a/README.md b/README.md index 3856a6b..6539d0f 100644 --- a/README.md +++ b/README.md @@ -4,34 +4,70 @@ This library has been created with the purpose to facilitate the store, validati # Installation ```bash -go get github.com/mikekonan/go-types +go get github.com/mikekonan/go-types/v2 ``` # Usage: ```go -//1. use in your structs +package main + +import ( + "encoding/json" + "fmt" + "log" + + validation "github.com/go-ozzo/ozzo-validation/v4" + "github.com/mikekonan/go-types/v2/country" + "github.com/mikekonan/go-types/v2/country/alpha2" + "github.com/mikekonan/go-types/v2/country/alpha3" + "github.com/mikekonan/go-types/v2/country/name" + "github.com/mikekonan/go-types/v2/currency" + "github.com/mikekonan/go-types/v2/currency/code" +) + +// 1. use in your structs type User struct { - Name string `json:"name" db:"name"` - Country country.Alpha2Code `json:"country" db:"country"` + Name string `json:"name" db:"name"` + Country country.Alpha2Code `json:"country" db:"country"` + Currency currency.Code `json:"currency" db:"currency"` } func main() { + // 2. use in your wire user := User{} - //2. use in your wire - json.Unmarshal([]byte(`{"name":"name", "country": "ca"}`), &user) - //3. check is set - user.Country.IsSet() //check user country is provided - //4. validate using ozzo-validation - if err := validation.ValidateStruct(&user, validation.Field(&user.Country)); err != nil { + _ = json.Unmarshal([]byte(`{"name":"name", "country": "CA", "currency": "CAD"}`), &user) + + // 3. check is set + user.Country.IsSet() + user.Currency.IsSet() + + // 4. validate using ozzo-validation + if err := validation.ValidateStruct(&user, validation.Field(&user.Country), validation.Field(&user.Currency)); err != nil { log.Fatal(err) } - //5. lookup by alpha2, alpha3, country name + + // 5. lookup by alpha2, alpha3, country name if userCountry, ok := country.ByAlpha2Code(user.Country); ok { - fmt.Printf("country name - '%s', alpha-2 - '%s', alpha-3 - '%s'", serCountry.Name(), userCountry.Alpha2Code(), userCountry.lpha3Code()) + fmt.Printf("country name - '%s', alpha-2 - '%s', alpha-3 - '%s'", userCountry.Name(), userCountry.Alpha2Code(), userCountry.Alpha3Code()) } - //6. store in db - fmt.Println(user.Country.Value()) //prints 'CA' - //7. use specific countries + + // 5. lookup by currency code + if userCurrency, ok := currency.ByCode(user.Currency); ok { + fmt.Printf("currency name - '%s', code - '%s', number - '%s', countries - '%s', decimal places - '%d'", + userCurrency.Currency(), userCurrency.Code(), userCurrency.Number(), userCurrency.Countries(), userCurrency.DecimalPlaces()) + } + + // 6. store in db + fmt.Println(user.Country.Value()) //prints 'CA' + fmt.Println(user.Currency.Value()) //prints 'CAN' + + // 7. use specific country constants fmt.Println(country.Canada.Alpha2Code()) + fmt.Println("name:", name.Canada) + fmt.Println("alpha-2:", alpha2.CA) + fmt.Println("alpha-3:", alpha3.CAN) + + // 8. use specific currency codes + fmt.Println(code.CAD) } ``` diff --git a/card/card.go b/card/card.go index 28d6171..33455d2 100644 --- a/card/card.go +++ b/card/card.go @@ -16,10 +16,10 @@ const ( gatewayCentury = 21 ) -//CardDate represents as expired card date type with format MM/YY +// CardDate represents as expired card date type with format MM/YY type CardDate string -//Value implementation of driver.Valuer +// Value implementation of driver.Valuer func (cardDate CardDate) Value() (value driver.Value, err error) { if err = cardDate.Validate(); err != nil { return nil, err @@ -28,7 +28,7 @@ func (cardDate CardDate) Value() (value driver.Value, err error) { return cardDate.String(), nil } -//UnmarshalJSON unmarshall implementation for CardDate +// UnmarshalJSON unmarshall implementation for CardDate func (cardDate *CardDate) UnmarshalJSON(data []byte) error { var str string if err := json.Unmarshal(data, &str); err != nil { @@ -50,7 +50,7 @@ func (cardDate *CardDate) UnmarshalJSON(data []byte) error { return nil } -//Validate implementation of ozzo-validation Validate interface +// Validate implementation of ozzo-validation Validate interface func (cardDate CardDate) Validate() error { if cardDate == "" { return fmt.Errorf("invalid CardDate: cannot be blank") @@ -72,7 +72,7 @@ func (cardDate CardDate) Validate() error { return nil } -//String implementation of Stringer interface +// String implementation of Stringer interface func (cardDate CardDate) String() string { return string(cardDate) } diff --git a/card/swagger.yaml b/card/swagger.yaml index 7e8ca61..de35310 100644 --- a/card/swagger.yaml +++ b/card/swagger.yaml @@ -4,4 +4,4 @@ components: CardDate: example: 01/06 type: string - x-go-type: github.com/mikekonan/go-types/card.CardDate + x-go-type: github.com/mikekonan/go-types/v2/card.CardDate diff --git a/country/.generator/app.js b/country/.generator/app.js index a5bb4a9..5622dfa 100644 --- a/country/.generator/app.js +++ b/country/.generator/app.js @@ -2,6 +2,7 @@ const fs = require("fs"); const transliterate = require("transliteration"); const yaml = require("yaml"); +//For testing purpose we can use raw/countries let codes = JSON.parse(fs.readFileSync(0, "utf8")); codes = codes.map((code) => { @@ -70,75 +71,69 @@ codes = codes.map((code) => { return result; }); -const countriesTemplate = `package country +const countriesTemplate = `package name + +import "github.com/mikekonan/go-types/v2/country" const ( -${codes - .map( - (code) => - `//${code.name.key} represents '${code.name.value}' country name -${code.name.key} = Name("${code.name.value}")` - ) - .join("\n")} +${codes.map( + (code) => `\t// ${code.key} represents '${code.name.value}' country name + ${code.key} = country.Name("${code.name.value}")` + ).join("\n")} ) `; -const alpha2Template = `package country +const alpha2Template = `package alpha2 + +import "github.com/mikekonan/go-types/v2/country" const ( -${codes - .map( - ( - code - ) => `//${code.a2.key} represents '${code.a2.value}' country alpha-2 code - ${code.a2.key} = Alpha2Code("${code.a2.value}")` - ) - .join("\n")} +${codes.map( + (code) => `\t// ${code.a2.value} represents '${code.a2.value}' country alpha-2 code + ${code.a2.value} = country.Alpha2Code("${code.a2.value}")` + ).join("\n")} ) `; -const alpha3Template = `package country +const alpha3Template = `package alpha3 + +import "github.com/mikekonan/go-types/v2/country" const ( -${codes - .map( - ( - code - ) => `//${code.a3.key} represents '${code.a3.value}' country alpha-3 code - ${code.a3.key} = Alpha3Code("${code.a3.value}")` - ) - .join("\n")} +${codes.map( + (code) => `\t// ${code.a3.value} represents '${code.a3.value}' country alpha-3 code + ${code.a3.value} = country.Alpha3Code("${code.a3.value}")` + ).join("\n")} ) `; const entitiesTemplate = `package country var ( -${codes - .map( - (code) => `//${code.key} represents '${code.name.value}' country - ${code.key} = Country{ - name: ${code.name.key}, - alpha2: ${code.a2.key}, - alpha3: ${code.a3.key}, +${codes.map( + (code) => `\t// ${code.key} represents '${code.name.value}' country + ${code.key} = Country{ + name: \"${code.name.value}\", + alpha2: \"${code.a2.value}\", + alpha3: \"${code.a3.value}\", }` - ) +) .join("\n")} -) +) `; const countryByCountryTemplate = `package country -var countryByName = map[Name]Country{ - ${codes.map((code) => `${code.name.key} : ${code.key}`).join(",\n")}, +var CountryByName = map[string]Country{ +${codes.map((code) => `\t\"${code.name.value}\" : ${code.key}`).join(",\n")}, } -var countryByAlpha2 = map[Alpha2Code]Country{ - ${codes.map((code) => `${code.a2.key} : ${code.key}`).join(",\n")}, +var CountryByAlpha2 = map[string]Country{ +${codes.map((code) => `\t\"${code.a2.value}\" : ${code.key}`).join(",\n")}, } -var countryByAlpha3 = map[Alpha3Code]Country{ - ${codes.map((code) => `${code.a3.key} : ${code.key}`).join(",\n")}, +var CountryByAlpha3 = map[string]Country{ +${codes.map((code) => `\t\"${code.a3.value}\" : ${code.key}`).join(",\n")}, } `; @@ -151,7 +146,7 @@ const spec = { type: "string", format: "iso3166-country", enum: [...new Set(codes.map((code) => code.name.value))], - "x-go-type": "github.com/mikekonan/go-types/country.Name", + "x-go-type": "github.com/mikekonan/go-types/v2/country.Name", }, CountryAlpha2: { example: "AS", @@ -160,7 +155,7 @@ const spec = { minLength: 2, maxLength: 2, enum: [...new Set(codes.map((code) => code.a2.value))], - "x-go-type": "github.com/mikekonan/go-types/country.Alpha2Code", + "x-go-type": "github.com/mikekonan/go-types/v2/country.Alpha2Code", }, CountryAlpha3: { example: "USA", @@ -169,22 +164,22 @@ const spec = { minLength: 3, maxLength: 3, enum: [...new Set(codes.map((code) => code.a3.value))], - "x-go-type": "github.com/mikekonan/go-types/country.Alpha3Code", + "x-go-type": "github.com/mikekonan/go-types/v2/country.Alpha3Code", } }, }, }; let writeFiles = [ - fs.writeFileSync("../name_gen.go", countriesTemplate, { + fs.writeFileSync("../name/name_gen.go", countriesTemplate, { encoding: "utf8", flag: "w", }), - fs.writeFileSync("../alpha2_gen.go", alpha2Template, { + fs.writeFileSync("../alpha2/alpha_2_gen.go", alpha2Template, { encoding: "utf8", flag: "w", }), - fs.writeFileSync("../alpha3_gen.go", alpha3Template, { + fs.writeFileSync("../alpha3/alpha_3_gen.go", alpha3Template, { encoding: "utf8", flag: "w", }), diff --git a/country/.generator/raw/countries b/country/.generator/raw/countries new file mode 100644 index 0000000..119cef7 --- /dev/null +++ b/country/.generator/raw/countries @@ -0,0 +1 @@ +[{"English short name":"Afghanistan","French short name":"Afghanistan (l')","Alpha-2 code":"AF","Alpha-3 code":"AFG","Numeric":"004"},{"English short name":"Albania","French short name":"Albanie (l')","Alpha-2 code":"AL","Alpha-3 code":"ALB","Numeric":"008"},{"English short name":"Algeria","French short name":"Algérie (l')","Alpha-2 code":"DZ","Alpha-3 code":"DZA","Numeric":"012"},{"English short name":"American Samoa","French short name":"Samoa américaines (les)","Alpha-2 code":"AS","Alpha-3 code":"ASM","Numeric":"016"},{"English short name":"Andorra","French short name":"Andorre (l')","Alpha-2 code":"AD","Alpha-3 code":"AND","Numeric":"020"},{"English short name":"Angola","French short name":"Angola (l')","Alpha-2 code":"AO","Alpha-3 code":"AGO","Numeric":"024"},{"English short name":"Anguilla","French short name":"Anguilla","Alpha-2 code":"AI","Alpha-3 code":"AIA","Numeric":"660"},{"English short name":"Antarctica","French short name":"Antarctique (l')","Alpha-2 code":"AQ","Alpha-3 code":"ATA","Numeric":"010"},{"English short name":"Antigua and Barbuda","French short name":"Antigua-et-Barbuda","Alpha-2 code":"AG","Alpha-3 code":"ATG","Numeric":"028"},{"English short name":"Argentina","French short name":"Argentine (l')","Alpha-2 code":"AR","Alpha-3 code":"ARG","Numeric":"032"},{"English short name":"Armenia","French short name":"Arménie (l')","Alpha-2 code":"AM","Alpha-3 code":"ARM","Numeric":"051"},{"English short name":"Aruba","French short name":"Aruba","Alpha-2 code":"AW","Alpha-3 code":"ABW","Numeric":"533"},{"English short name":"Australia","French short name":"Australie (l')","Alpha-2 code":"AU","Alpha-3 code":"AUS","Numeric":"036"},{"English short name":"Austria","French short name":"Autriche (l')","Alpha-2 code":"AT","Alpha-3 code":"AUT","Numeric":"040"},{"English short name":"Azerbaijan","French short name":"Azerbaïdjan (l')","Alpha-2 code":"AZ","Alpha-3 code":"AZE","Numeric":"031"},{"English short name":"Bahamas (the)","French short name":"Bahamas (les)","Alpha-2 code":"BS","Alpha-3 code":"BHS","Numeric":"044"},{"English short name":"Bahrain","French short name":"Bahreïn","Alpha-2 code":"BH","Alpha-3 code":"BHR","Numeric":"048"},{"English short name":"Bangladesh","French short name":"Bangladesh (le)","Alpha-2 code":"BD","Alpha-3 code":"BGD","Numeric":"050"},{"English short name":"Barbados","French short name":"Barbade (la)","Alpha-2 code":"BB","Alpha-3 code":"BRB","Numeric":"052"},{"English short name":"Belarus","French short name":"Bélarus (le)","Alpha-2 code":"BY","Alpha-3 code":"BLR","Numeric":"112"},{"English short name":"Belgium","French short name":"Belgique (la)","Alpha-2 code":"BE","Alpha-3 code":"BEL","Numeric":"056"},{"English short name":"Belize","French short name":"Belize (le)","Alpha-2 code":"BZ","Alpha-3 code":"BLZ","Numeric":"084"},{"English short name":"Benin","French short name":"Bénin (le)","Alpha-2 code":"BJ","Alpha-3 code":"BEN","Numeric":"204"},{"English short name":"Bermuda","French short name":"Bermudes (les)","Alpha-2 code":"BM","Alpha-3 code":"BMU","Numeric":"060"},{"English short name":"Bhutan","French short name":"Bhoutan (le)","Alpha-2 code":"BT","Alpha-3 code":"BTN","Numeric":"064"},{"English short name":"Bolivia (Plurinational State of)","French short name":"Bolivie (État plurinational de)","Alpha-2 code":"BO","Alpha-3 code":"BOL","Numeric":"068"},{"English short name":"Bonaire, Sint Eustatius and Saba","French short name":"Bonaire, Saint-Eustache et Saba","Alpha-2 code":"BQ","Alpha-3 code":"BES","Numeric":"535"},{"English short name":"Bosnia and Herzegovina","French short name":"Bosnie-Herzégovine (la)","Alpha-2 code":"BA","Alpha-3 code":"BIH","Numeric":"070"},{"English short name":"Botswana","French short name":"Botswana (le)","Alpha-2 code":"BW","Alpha-3 code":"BWA","Numeric":"072"},{"English short name":"Bouvet Island","French short name":"Bouvet (l'Île)","Alpha-2 code":"BV","Alpha-3 code":"BVT","Numeric":"074"},{"English short name":"Brazil","French short name":"Brésil (le)","Alpha-2 code":"BR","Alpha-3 code":"BRA","Numeric":"076"},{"English short name":"British Indian Ocean Territory (the)","French short name":"Indien (le Territoire britannique de l'océan)","Alpha-2 code":"IO","Alpha-3 code":"IOT","Numeric":"086"},{"English short name":"Brunei Darussalam","French short name":"Brunéi Darussalam (le)","Alpha-2 code":"BN","Alpha-3 code":"BRN","Numeric":"096"},{"English short name":"Bulgaria","French short name":"Bulgarie (la)","Alpha-2 code":"BG","Alpha-3 code":"BGR","Numeric":"100"},{"English short name":"Burkina Faso","French short name":"Burkina Faso (le)","Alpha-2 code":"BF","Alpha-3 code":"BFA","Numeric":"854"},{"English short name":"Burundi","French short name":"Burundi (le)","Alpha-2 code":"BI","Alpha-3 code":"BDI","Numeric":"108"},{"English short name":"Cabo Verde","French short name":"Cabo Verde","Alpha-2 code":"CV","Alpha-3 code":"CPV","Numeric":"132"},{"English short name":"Cambodia","French short name":"Cambodge (le)","Alpha-2 code":"KH","Alpha-3 code":"KHM","Numeric":"116"},{"English short name":"Cameroon","French short name":"Cameroun (le)","Alpha-2 code":"CM","Alpha-3 code":"CMR","Numeric":"120"},{"English short name":"Canada","French short name":"Canada (le)","Alpha-2 code":"CA","Alpha-3 code":"CAN","Numeric":"124"},{"English short name":"Cayman Islands (the)","French short name":"Caïmans (les Îles)","Alpha-2 code":"KY","Alpha-3 code":"CYM","Numeric":"136"},{"English short name":"Central African Republic (the)","French short name":"République centrafricaine (la)","Alpha-2 code":"CF","Alpha-3 code":"CAF","Numeric":"140"},{"English short name":"Chad","French short name":"Tchad (le)","Alpha-2 code":"TD","Alpha-3 code":"TCD","Numeric":"148"},{"English short name":"Chile","French short name":"Chili (le)","Alpha-2 code":"CL","Alpha-3 code":"CHL","Numeric":"152"},{"English short name":"China","French short name":"Chine (la)","Alpha-2 code":"CN","Alpha-3 code":"CHN","Numeric":"156"},{"English short name":"Christmas Island","French short name":"Christmas (l'Île)","Alpha-2 code":"CX","Alpha-3 code":"CXR","Numeric":"162"},{"English short name":"Cocos (Keeling) Islands (the)","French short name":"Cocos (les Îles)/ Keeling (les Îles)","Alpha-2 code":"CC","Alpha-3 code":"CCK","Numeric":"166"},{"English short name":"Colombia","French short name":"Colombie (la)","Alpha-2 code":"CO","Alpha-3 code":"COL","Numeric":"170"},{"English short name":"Comoros (the)","French short name":"Comores (les)","Alpha-2 code":"KM","Alpha-3 code":"COM","Numeric":"174"},{"English short name":"Congo (the Democratic Republic of the)","French short name":"Congo (la République démocratique du)","Alpha-2 code":"CD","Alpha-3 code":"COD","Numeric":"180"},{"English short name":"Congo (the)","French short name":"Congo (le)","Alpha-2 code":"CG","Alpha-3 code":"COG","Numeric":"178"},{"English short name":"Cook Islands (the)","French short name":"Cook (les Îles)","Alpha-2 code":"CK","Alpha-3 code":"COK","Numeric":"184"},{"English short name":"Costa Rica","French short name":"Costa Rica (le)","Alpha-2 code":"CR","Alpha-3 code":"CRI","Numeric":"188"},{"English short name":"Croatia","French short name":"Croatie (la)","Alpha-2 code":"HR","Alpha-3 code":"HRV","Numeric":"191"},{"English short name":"Cuba","French short name":"Cuba","Alpha-2 code":"CU","Alpha-3 code":"CUB","Numeric":"192"},{"English short name":"Curaçao","French short name":"Curaçao","Alpha-2 code":"CW","Alpha-3 code":"CUW","Numeric":"531"},{"English short name":"Cyprus","French short name":"Chypre","Alpha-2 code":"CY","Alpha-3 code":"CYP","Numeric":"196"},{"English short name":"Czechia","French short name":"Tchéquie (la)","Alpha-2 code":"CZ","Alpha-3 code":"CZE","Numeric":"203"},{"English short name":"Côte d'Ivoire","French short name":"Côte d'Ivoire (la)","Alpha-2 code":"CI","Alpha-3 code":"CIV","Numeric":"384"},{"English short name":"Denmark","French short name":"Danemark (le)","Alpha-2 code":"DK","Alpha-3 code":"DNK","Numeric":"208"},{"English short name":"Djibouti","French short name":"Djibouti","Alpha-2 code":"DJ","Alpha-3 code":"DJI","Numeric":"262"},{"English short name":"Dominica","French short name":"Dominique (la)","Alpha-2 code":"DM","Alpha-3 code":"DMA","Numeric":"212"},{"English short name":"Dominican Republic (the)","French short name":"dominicaine (la République)","Alpha-2 code":"DO","Alpha-3 code":"DOM","Numeric":"214"},{"English short name":"Ecuador","French short name":"Équateur (l')","Alpha-2 code":"EC","Alpha-3 code":"ECU","Numeric":"218"},{"English short name":"Egypt","French short name":"Égypte (l')","Alpha-2 code":"EG","Alpha-3 code":"EGY","Numeric":"818"},{"English short name":"El Salvador","French short name":"El Salvador","Alpha-2 code":"SV","Alpha-3 code":"SLV","Numeric":"222"},{"English short name":"Equatorial Guinea","French short name":"Guinée équatoriale (la)","Alpha-2 code":"GQ","Alpha-3 code":"GNQ","Numeric":"226"},{"English short name":"Eritrea","French short name":"Érythrée (l')","Alpha-2 code":"ER","Alpha-3 code":"ERI","Numeric":"232"},{"English short name":"Estonia","French short name":"Estonie (l')","Alpha-2 code":"EE","Alpha-3 code":"EST","Numeric":"233"},{"English short name":"Eswatini","French short name":"Eswatini (l')","Alpha-2 code":"SZ","Alpha-3 code":"SWZ","Numeric":"748"},{"English short name":"Ethiopia","French short name":"Éthiopie (l')","Alpha-2 code":"ET","Alpha-3 code":"ETH","Numeric":"231"},{"English short name":"Falkland Islands (the) [Malvinas]","French short name":"Falkland (les Îles)/Malouines (les Îles)","Alpha-2 code":"FK","Alpha-3 code":"FLK","Numeric":"238"},{"English short name":"Faroe Islands (the)","French short name":"Féroé (les Îles)","Alpha-2 code":"FO","Alpha-3 code":"FRO","Numeric":"234"},{"English short name":"Fiji","French short name":"Fidji (les)","Alpha-2 code":"FJ","Alpha-3 code":"FJI","Numeric":"242"},{"English short name":"Finland","French short name":"Finlande (la)","Alpha-2 code":"FI","Alpha-3 code":"FIN","Numeric":"246"},{"English short name":"France","French short name":"France (la)","Alpha-2 code":"FR","Alpha-3 code":"FRA","Numeric":"250"},{"English short name":"French Guiana","French short name":"Guyane française (la )","Alpha-2 code":"GF","Alpha-3 code":"GUF","Numeric":"254"},{"English short name":"French Polynesia","French short name":"Polynésie française (la)","Alpha-2 code":"PF","Alpha-3 code":"PYF","Numeric":"258"},{"English short name":"French Southern Territories (the)","French short name":"Terres australes françaises (les)","Alpha-2 code":"TF","Alpha-3 code":"ATF","Numeric":"260"},{"English short name":"Gabon","French short name":"Gabon (le)","Alpha-2 code":"GA","Alpha-3 code":"GAB","Numeric":"266"},{"English short name":"Gambia (the)","French short name":"Gambie (la)","Alpha-2 code":"GM","Alpha-3 code":"GMB","Numeric":"270"},{"English short name":"Georgia","French short name":"Géorgie (la)","Alpha-2 code":"GE","Alpha-3 code":"GEO","Numeric":"268"},{"English short name":"Germany","French short name":"Allemagne (l')","Alpha-2 code":"DE","Alpha-3 code":"DEU","Numeric":"276"},{"English short name":"Ghana","French short name":"Ghana (le)","Alpha-2 code":"GH","Alpha-3 code":"GHA","Numeric":"288"},{"English short name":"Gibraltar","French short name":"Gibraltar","Alpha-2 code":"GI","Alpha-3 code":"GIB","Numeric":"292"},{"English short name":"Greece","French short name":"Grèce (la)","Alpha-2 code":"GR","Alpha-3 code":"GRC","Numeric":"300"},{"English short name":"Greenland","French short name":"Groenland (le)","Alpha-2 code":"GL","Alpha-3 code":"GRL","Numeric":"304"},{"English short name":"Grenada","French short name":"Grenade (la)","Alpha-2 code":"GD","Alpha-3 code":"GRD","Numeric":"308"},{"English short name":"Guadeloupe","French short name":"Guadeloupe (la)","Alpha-2 code":"GP","Alpha-3 code":"GLP","Numeric":"312"},{"English short name":"Guam","French short name":"Guam","Alpha-2 code":"GU","Alpha-3 code":"GUM","Numeric":"316"},{"English short name":"Guatemala","French short name":"Guatemala (le)","Alpha-2 code":"GT","Alpha-3 code":"GTM","Numeric":"320"},{"English short name":"Guernsey","French short name":"Guernesey","Alpha-2 code":"GG","Alpha-3 code":"GGY","Numeric":"831"},{"English short name":"Guinea","French short name":"Guinée (la)","Alpha-2 code":"GN","Alpha-3 code":"GIN","Numeric":"324"},{"English short name":"Guinea-Bissau","French short name":"Guinée-Bissau (la)","Alpha-2 code":"GW","Alpha-3 code":"GNB","Numeric":"624"},{"English short name":"Guyana","French short name":"Guyana (le)","Alpha-2 code":"GY","Alpha-3 code":"GUY","Numeric":"328"},{"English short name":"Haiti","French short name":"Haïti","Alpha-2 code":"HT","Alpha-3 code":"HTI","Numeric":"332"},{"English short name":"Heard Island and McDonald Islands","French short name":"Heard-et-Îles MacDonald (l'Île)","Alpha-2 code":"HM","Alpha-3 code":"HMD","Numeric":"334"},{"English short name":"Holy See (the)","French short name":"Saint-Siège (le)","Alpha-2 code":"VA","Alpha-3 code":"VAT","Numeric":"336"},{"English short name":"Honduras","French short name":"Honduras (le)","Alpha-2 code":"HN","Alpha-3 code":"HND","Numeric":"340"},{"English short name":"Hong Kong","French short name":"Hong Kong","Alpha-2 code":"HK","Alpha-3 code":"HKG","Numeric":"344"},{"English short name":"Hungary","French short name":"Hongrie (la)","Alpha-2 code":"HU","Alpha-3 code":"HUN","Numeric":"348"},{"English short name":"Iceland","French short name":"Islande (l')","Alpha-2 code":"IS","Alpha-3 code":"ISL","Numeric":"352"},{"English short name":"India","French short name":"Inde (l')","Alpha-2 code":"IN","Alpha-3 code":"IND","Numeric":"356"},{"English short name":"Indonesia","French short name":"Indonésie (l')","Alpha-2 code":"ID","Alpha-3 code":"IDN","Numeric":"360"},{"English short name":"Iran (Islamic Republic of)","French short name":"Iran (République Islamique d')","Alpha-2 code":"IR","Alpha-3 code":"IRN","Numeric":"364"},{"English short name":"Iraq","French short name":"Iraq (l')","Alpha-2 code":"IQ","Alpha-3 code":"IRQ","Numeric":"368"},{"English short name":"Ireland","French short name":"Irlande (l')","Alpha-2 code":"IE","Alpha-3 code":"IRL","Numeric":"372"},{"English short name":"Isle of Man","French short name":"Île de Man","Alpha-2 code":"IM","Alpha-3 code":"IMN","Numeric":"833"},{"English short name":"Israel","French short name":"Israël","Alpha-2 code":"IL","Alpha-3 code":"ISR","Numeric":"376"},{"English short name":"Italy","French short name":"Italie (l')","Alpha-2 code":"IT","Alpha-3 code":"ITA","Numeric":"380"},{"English short name":"Jamaica","French short name":"Jamaïque (la)","Alpha-2 code":"JM","Alpha-3 code":"JAM","Numeric":"388"},{"English short name":"Japan","French short name":"Japon (le)","Alpha-2 code":"JP","Alpha-3 code":"JPN","Numeric":"392"},{"English short name":"Jersey","French short name":"Jersey","Alpha-2 code":"JE","Alpha-3 code":"JEY","Numeric":"832"},{"English short name":"Jordan","French short name":"Jordanie (la)","Alpha-2 code":"JO","Alpha-3 code":"JOR","Numeric":"400"},{"English short name":"Kazakhstan","French short name":"Kazakhstan (le)","Alpha-2 code":"KZ","Alpha-3 code":"KAZ","Numeric":"398"},{"English short name":"Kenya","French short name":"Kenya (le)","Alpha-2 code":"KE","Alpha-3 code":"KEN","Numeric":"404"},{"English short name":"Kiribati","French short name":"Kiribati","Alpha-2 code":"KI","Alpha-3 code":"KIR","Numeric":"296"},{"English short name":"Korea (the Democratic People's Republic of)","French short name":"Corée (la République populaire démocratique de)","Alpha-2 code":"KP","Alpha-3 code":"PRK","Numeric":"408"},{"English short name":"Korea (the Republic of)","French short name":"Corée (la République de)","Alpha-2 code":"KR","Alpha-3 code":"KOR","Numeric":"410"},{"English short name":"Kuwait","French short name":"Koweït (le)","Alpha-2 code":"KW","Alpha-3 code":"KWT","Numeric":"414"},{"English short name":"Kyrgyzstan","French short name":"Kirghizistan (le)","Alpha-2 code":"KG","Alpha-3 code":"KGZ","Numeric":"417"},{"English short name":"Lao People's Democratic Republic (the)","French short name":"Lao (la République démocratique populaire)","Alpha-2 code":"LA","Alpha-3 code":"LAO","Numeric":"418"},{"English short name":"Latvia","French short name":"Lettonie (la)","Alpha-2 code":"LV","Alpha-3 code":"LVA","Numeric":"428"},{"English short name":"Lebanon","French short name":"Liban (le)","Alpha-2 code":"LB","Alpha-3 code":"LBN","Numeric":"422"},{"English short name":"Lesotho","French short name":"Lesotho (le)","Alpha-2 code":"LS","Alpha-3 code":"LSO","Numeric":"426"},{"English short name":"Liberia","French short name":"Libéria (le)","Alpha-2 code":"LR","Alpha-3 code":"LBR","Numeric":"430"},{"English short name":"Libya","French short name":"Libye (la)","Alpha-2 code":"LY","Alpha-3 code":"LBY","Numeric":"434"},{"English short name":"Liechtenstein","French short name":"Liechtenstein (le)","Alpha-2 code":"LI","Alpha-3 code":"LIE","Numeric":"438"},{"English short name":"Lithuania","French short name":"Lituanie (la)","Alpha-2 code":"LT","Alpha-3 code":"LTU","Numeric":"440"},{"English short name":"Luxembourg","French short name":"Luxembourg (le)","Alpha-2 code":"LU","Alpha-3 code":"LUX","Numeric":"442"},{"English short name":"Macao","French short name":"Macao","Alpha-2 code":"MO","Alpha-3 code":"MAC","Numeric":"446"},{"English short name":"Madagascar","French short name":"Madagascar","Alpha-2 code":"MG","Alpha-3 code":"MDG","Numeric":"450"},{"English short name":"Malawi","French short name":"Malawi (le)","Alpha-2 code":"MW","Alpha-3 code":"MWI","Numeric":"454"},{"English short name":"Malaysia","French short name":"Malaisie (la)","Alpha-2 code":"MY","Alpha-3 code":"MYS","Numeric":"458"},{"English short name":"Maldives","French short name":"Maldives (les)","Alpha-2 code":"MV","Alpha-3 code":"MDV","Numeric":"462"},{"English short name":"Mali","French short name":"Mali (le)","Alpha-2 code":"ML","Alpha-3 code":"MLI","Numeric":"466"},{"English short name":"Malta","French short name":"Malte","Alpha-2 code":"MT","Alpha-3 code":"MLT","Numeric":"470"},{"English short name":"Marshall Islands (the)","French short name":"Marshall (les Îles)","Alpha-2 code":"MH","Alpha-3 code":"MHL","Numeric":"584"},{"English short name":"Martinique","French short name":"Martinique (la)","Alpha-2 code":"MQ","Alpha-3 code":"MTQ","Numeric":"474"},{"English short name":"Mauritania","French short name":"Mauritanie (la)","Alpha-2 code":"MR","Alpha-3 code":"MRT","Numeric":"478"},{"English short name":"Mauritius","French short name":"Maurice","Alpha-2 code":"MU","Alpha-3 code":"MUS","Numeric":"480"},{"English short name":"Mayotte","French short name":"Mayotte","Alpha-2 code":"YT","Alpha-3 code":"MYT","Numeric":"175"},{"English short name":"Mexico","French short name":"Mexique (le)","Alpha-2 code":"MX","Alpha-3 code":"MEX","Numeric":"484"},{"English short name":"Micronesia (Federated States of)","French short name":"Micronésie (États fédérés de)","Alpha-2 code":"FM","Alpha-3 code":"FSM","Numeric":"583"},{"English short name":"Moldova (the Republic of)","French short name":"Moldova (la République de)","Alpha-2 code":"MD","Alpha-3 code":"MDA","Numeric":"498"},{"English short name":"Monaco","French short name":"Monaco","Alpha-2 code":"MC","Alpha-3 code":"MCO","Numeric":"492"},{"English short name":"Mongolia","French short name":"Mongolie (la)","Alpha-2 code":"MN","Alpha-3 code":"MNG","Numeric":"496"},{"English short name":"Montenegro","French short name":"Monténégro (le)","Alpha-2 code":"ME","Alpha-3 code":"MNE","Numeric":"499"},{"English short name":"Montserrat","French short name":"Montserrat","Alpha-2 code":"MS","Alpha-3 code":"MSR","Numeric":"500"},{"English short name":"Morocco","French short name":"Maroc (le)","Alpha-2 code":"MA","Alpha-3 code":"MAR","Numeric":"504"},{"English short name":"Mozambique","French short name":"Mozambique (le)","Alpha-2 code":"MZ","Alpha-3 code":"MOZ","Numeric":"508"},{"English short name":"Myanmar","French short name":"Myanmar (le)","Alpha-2 code":"MM","Alpha-3 code":"MMR","Numeric":"104"},{"English short name":"Namibia","French short name":"Namibie (la)","Alpha-2 code":"NA","Alpha-3 code":"NAM","Numeric":"516"},{"English short name":"Nauru","French short name":"Nauru","Alpha-2 code":"NR","Alpha-3 code":"NRU","Numeric":"520"},{"English short name":"Nepal","French short name":"Népal (le)","Alpha-2 code":"NP","Alpha-3 code":"NPL","Numeric":"524"},{"English short name":"Netherlands (the)","French short name":"Pays-Bas (les)","Alpha-2 code":"NL","Alpha-3 code":"NLD","Numeric":"528"},{"English short name":"New Caledonia","French short name":"Nouvelle-Calédonie (la)","Alpha-2 code":"NC","Alpha-3 code":"NCL","Numeric":"540"},{"English short name":"New Zealand","French short name":"Nouvelle-Zélande (la)","Alpha-2 code":"NZ","Alpha-3 code":"NZL","Numeric":"554"},{"English short name":"Nicaragua","French short name":"Nicaragua (le)","Alpha-2 code":"NI","Alpha-3 code":"NIC","Numeric":"558"},{"English short name":"Niger (the)","French short name":"Niger (le)","Alpha-2 code":"NE","Alpha-3 code":"NER","Numeric":"562"},{"English short name":"Nigeria","French short name":"Nigéria (le)","Alpha-2 code":"NG","Alpha-3 code":"NGA","Numeric":"566"},{"English short name":"Niue","French short name":"Niue","Alpha-2 code":"NU","Alpha-3 code":"NIU","Numeric":"570"},{"English short name":"Norfolk Island","French short name":"Norfolk (l'Île)","Alpha-2 code":"NF","Alpha-3 code":"NFK","Numeric":"574"},{"English short name":"North Macedonia","French short name":"Macédoine du Nord (la)","Alpha-2 code":"MK","Alpha-3 code":"MKD","Numeric":"807"},{"English short name":"Northern Mariana Islands (the)","French short name":"Mariannes du Nord (les Îles)","Alpha-2 code":"MP","Alpha-3 code":"MNP","Numeric":"580"},{"English short name":"Norway","French short name":"Norvège (la)","Alpha-2 code":"NO","Alpha-3 code":"NOR","Numeric":"578"},{"English short name":"Oman","French short name":"Oman","Alpha-2 code":"OM","Alpha-3 code":"OMN","Numeric":"512"},{"English short name":"Pakistan","French short name":"Pakistan (le)","Alpha-2 code":"PK","Alpha-3 code":"PAK","Numeric":"586"},{"English short name":"Palau","French short name":"Palaos (les)","Alpha-2 code":"PW","Alpha-3 code":"PLW","Numeric":"585"},{"English short name":"Palestine, State of","French short name":"Palestine, État de","Alpha-2 code":"PS","Alpha-3 code":"PSE","Numeric":"275"},{"English short name":"Panama","French short name":"Panama (le)","Alpha-2 code":"PA","Alpha-3 code":"PAN","Numeric":"591"},{"English short name":"Papua New Guinea","French short name":"Papouasie-Nouvelle-Guinée (la)","Alpha-2 code":"PG","Alpha-3 code":"PNG","Numeric":"598"},{"English short name":"Paraguay","French short name":"Paraguay (le)","Alpha-2 code":"PY","Alpha-3 code":"PRY","Numeric":"600"},{"English short name":"Peru","French short name":"Pérou (le)","Alpha-2 code":"PE","Alpha-3 code":"PER","Numeric":"604"},{"English short name":"Philippines (the)","French short name":"Philippines (les)","Alpha-2 code":"PH","Alpha-3 code":"PHL","Numeric":"608"},{"English short name":"Pitcairn","French short name":"Pitcairn","Alpha-2 code":"PN","Alpha-3 code":"PCN","Numeric":"612"},{"English short name":"Poland","French short name":"Pologne (la)","Alpha-2 code":"PL","Alpha-3 code":"POL","Numeric":"616"},{"English short name":"Portugal","French short name":"Portugal (le)","Alpha-2 code":"PT","Alpha-3 code":"PRT","Numeric":"620"},{"English short name":"Puerto Rico","French short name":"Porto Rico","Alpha-2 code":"PR","Alpha-3 code":"PRI","Numeric":"630"},{"English short name":"Qatar","French short name":"Qatar (le)","Alpha-2 code":"QA","Alpha-3 code":"QAT","Numeric":"634"},{"English short name":"Romania","French short name":"Roumanie (la)","Alpha-2 code":"RO","Alpha-3 code":"ROU","Numeric":"642"},{"English short name":"Russian Federation (the)","French short name":"Russie (la Fédération de)","Alpha-2 code":"RU","Alpha-3 code":"RUS","Numeric":"643"},{"English short name":"Rwanda","French short name":"Rwanda (le)","Alpha-2 code":"RW","Alpha-3 code":"RWA","Numeric":"646"},{"English short name":"Réunion","French short name":"Réunion (La)","Alpha-2 code":"RE","Alpha-3 code":"REU","Numeric":"638"},{"English short name":"Saint Barthélemy","French short name":"Saint-Barthélemy","Alpha-2 code":"BL","Alpha-3 code":"BLM","Numeric":"652"},{"English short name":"Saint Helena, Ascension and Tristan da Cunha","French short name":"Sainte-Hélène, Ascension et Tristan da Cunha","Alpha-2 code":"SH","Alpha-3 code":"SHN","Numeric":"654"},{"English short name":"Saint Kitts and Nevis","French short name":"Saint-Kitts-et-Nevis","Alpha-2 code":"KN","Alpha-3 code":"KNA","Numeric":"659"},{"English short name":"Saint Lucia","French short name":"Sainte-Lucie","Alpha-2 code":"LC","Alpha-3 code":"LCA","Numeric":"662"},{"English short name":"Saint Martin (French part)","French short name":"Saint-Martin (partie française)","Alpha-2 code":"MF","Alpha-3 code":"MAF","Numeric":"663"},{"English short name":"Saint Pierre and Miquelon","French short name":"Saint-Pierre-et-Miquelon","Alpha-2 code":"PM","Alpha-3 code":"SPM","Numeric":"666"},{"English short name":"Saint Vincent and the Grenadines","French short name":"Saint-Vincent-et-les Grenadines","Alpha-2 code":"VC","Alpha-3 code":"VCT","Numeric":"670"},{"English short name":"Samoa","French short name":"Samoa (le)","Alpha-2 code":"WS","Alpha-3 code":"WSM","Numeric":"882"},{"English short name":"San Marino","French short name":"Saint-Marin","Alpha-2 code":"SM","Alpha-3 code":"SMR","Numeric":"674"},{"English short name":"Sao Tome and Principe","French short name":"Sao Tomé-et-Principe","Alpha-2 code":"ST","Alpha-3 code":"STP","Numeric":"678"},{"English short name":"Saudi Arabia","French short name":"Arabie saoudite (l')","Alpha-2 code":"SA","Alpha-3 code":"SAU","Numeric":"682"},{"English short name":"Senegal","French short name":"Sénégal (le)","Alpha-2 code":"SN","Alpha-3 code":"SEN","Numeric":"686"},{"English short name":"Serbia","French short name":"Serbie (la)","Alpha-2 code":"RS","Alpha-3 code":"SRB","Numeric":"688"},{"English short name":"Seychelles","French short name":"Seychelles (les)","Alpha-2 code":"SC","Alpha-3 code":"SYC","Numeric":"690"},{"English short name":"Sierra Leone","French short name":"Sierra Leone (la)","Alpha-2 code":"SL","Alpha-3 code":"SLE","Numeric":"694"},{"English short name":"Singapore","French short name":"Singapour","Alpha-2 code":"SG","Alpha-3 code":"SGP","Numeric":"702"},{"English short name":"Sint Maarten (Dutch part)","French short name":"Saint-Martin (partie néerlandaise)","Alpha-2 code":"SX","Alpha-3 code":"SXM","Numeric":"534"},{"English short name":"Slovakia","French short name":"Slovaquie (la)","Alpha-2 code":"SK","Alpha-3 code":"SVK","Numeric":"703"},{"English short name":"Slovenia","French short name":"Slovénie (la)","Alpha-2 code":"SI","Alpha-3 code":"SVN","Numeric":"705"},{"English short name":"Solomon Islands","French short name":"Salomon (les Îles)","Alpha-2 code":"SB","Alpha-3 code":"SLB","Numeric":"090"},{"English short name":"Somalia","French short name":"Somalie (la)","Alpha-2 code":"SO","Alpha-3 code":"SOM","Numeric":"706"},{"English short name":"South Africa","French short name":"Afrique du Sud (l')","Alpha-2 code":"ZA","Alpha-3 code":"ZAF","Numeric":"710"},{"English short name":"South Georgia and the South Sandwich Islands","French short name":"Géorgie du Sud-et-les Îles Sandwich du Sud (la)","Alpha-2 code":"GS","Alpha-3 code":"SGS","Numeric":"239"},{"English short name":"South Sudan","French short name":"Soudan du Sud (le)","Alpha-2 code":"SS","Alpha-3 code":"SSD","Numeric":"728"},{"English short name":"Spain","French short name":"Espagne (l')","Alpha-2 code":"ES","Alpha-3 code":"ESP","Numeric":"724"},{"English short name":"Sri Lanka","French short name":"Sri Lanka","Alpha-2 code":"LK","Alpha-3 code":"LKA","Numeric":"144"},{"English short name":"Sudan (the)","French short name":"Soudan (le)","Alpha-2 code":"SD","Alpha-3 code":"SDN","Numeric":"729"},{"English short name":"Suriname","French short name":"Suriname (le)","Alpha-2 code":"SR","Alpha-3 code":"SUR","Numeric":"740"},{"English short name":"Svalbard and Jan Mayen","French short name":"Svalbard et l'Île Jan Mayen (le)","Alpha-2 code":"SJ","Alpha-3 code":"SJM","Numeric":"744"},{"English short name":"Sweden","French short name":"Suède (la)","Alpha-2 code":"SE","Alpha-3 code":"SWE","Numeric":"752"},{"English short name":"Switzerland","French short name":"Suisse (la)","Alpha-2 code":"CH","Alpha-3 code":"CHE","Numeric":"756"},{"English short name":"Syrian Arab Republic (the)","French short name":"République arabe syrienne (la)","Alpha-2 code":"SY","Alpha-3 code":"SYR","Numeric":"760"},{"English short name":"Taiwan (Province of China)","French short name":"Taïwan (Province de Chine)","Alpha-2 code":"TW","Alpha-3 code":"TWN","Numeric":"158"},{"English short name":"Tajikistan","French short name":"Tadjikistan (le)","Alpha-2 code":"TJ","Alpha-3 code":"TJK","Numeric":"762"},{"English short name":"Tanzania, the United Republic of","French short name":"Tanzanie (la République-Unie de)","Alpha-2 code":"TZ","Alpha-3 code":"TZA","Numeric":"834"},{"English short name":"Thailand","French short name":"Thaïlande (la)","Alpha-2 code":"TH","Alpha-3 code":"THA","Numeric":"764"},{"English short name":"Timor-Leste","French short name":"Timor-Leste (le)","Alpha-2 code":"TL","Alpha-3 code":"TLS","Numeric":"626"},{"English short name":"Togo","French short name":"Togo (le)","Alpha-2 code":"TG","Alpha-3 code":"TGO","Numeric":"768"},{"English short name":"Tokelau","French short name":"Tokelau (les)","Alpha-2 code":"TK","Alpha-3 code":"TKL","Numeric":"772"},{"English short name":"Tonga","French short name":"Tonga (les)","Alpha-2 code":"TO","Alpha-3 code":"TON","Numeric":"776"},{"English short name":"Trinidad and Tobago","French short name":"Trinité-et-Tobago (la)","Alpha-2 code":"TT","Alpha-3 code":"TTO","Numeric":"780"},{"English short name":"Tunisia","French short name":"Tunisie (la)","Alpha-2 code":"TN","Alpha-3 code":"TUN","Numeric":"788"},{"English short name":"Turkmenistan","French short name":"Turkménistan (le)","Alpha-2 code":"TM","Alpha-3 code":"TKM","Numeric":"795"},{"English short name":"Turks and Caicos Islands (the)","French short name":"Turks-et-Caïcos (les Îles)","Alpha-2 code":"TC","Alpha-3 code":"TCA","Numeric":"796"},{"English short name":"Tuvalu","French short name":"Tuvalu (les)","Alpha-2 code":"TV","Alpha-3 code":"TUV","Numeric":"798"},{"English short name":"Türkiye","French short name":"Türkiye (la)","Alpha-2 code":"TR","Alpha-3 code":"TUR","Numeric":"792"},{"English short name":"Uganda","French short name":"Ouganda (l')","Alpha-2 code":"UG","Alpha-3 code":"UGA","Numeric":"800"},{"English short name":"Ukraine","French short name":"Ukraine (l')","Alpha-2 code":"UA","Alpha-3 code":"UKR","Numeric":"804"},{"English short name":"United Arab Emirates (the)","French short name":"Émirats arabes unis (les)","Alpha-2 code":"AE","Alpha-3 code":"ARE","Numeric":"784"},{"English short name":"United Kingdom of Great Britain and Northern Ireland (the)","French short name":"Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le)","Alpha-2 code":"GB","Alpha-3 code":"GBR","Numeric":"826"},{"English short name":"United States Minor Outlying Islands (the)","French short name":"Îles mineures éloignées des États-Unis (les)","Alpha-2 code":"UM","Alpha-3 code":"UMI","Numeric":"581"},{"English short name":"United States of America (the)","French short name":"États-Unis d'Amérique (les)","Alpha-2 code":"US","Alpha-3 code":"USA","Numeric":"840"},{"English short name":"Uruguay","French short name":"Uruguay (l')","Alpha-2 code":"UY","Alpha-3 code":"URY","Numeric":"858"},{"English short name":"Uzbekistan","French short name":"Ouzbékistan (l')","Alpha-2 code":"UZ","Alpha-3 code":"UZB","Numeric":"860"},{"English short name":"Vanuatu","French short name":"Vanuatu (le)","Alpha-2 code":"VU","Alpha-3 code":"VUT","Numeric":"548"},{"English short name":"Venezuela (Bolivarian Republic of)","French short name":"Venezuela (République bolivarienne du)","Alpha-2 code":"VE","Alpha-3 code":"VEN","Numeric":"862"},{"English short name":"Viet Nam","French short name":"Viet Nam (le)","Alpha-2 code":"VN","Alpha-3 code":"VNM","Numeric":"704"},{"English short name":"Virgin Islands (British)","French short name":"Vierges britanniques (les Îles)","Alpha-2 code":"VG","Alpha-3 code":"VGB","Numeric":"092"},{"English short name":"Virgin Islands (U.S.)","French short name":"Vierges des États-Unis (les Îles)","Alpha-2 code":"VI","Alpha-3 code":"VIR","Numeric":"850"},{"English short name":"Wallis and Futuna","French short name":"Wallis-et-Futuna ","Alpha-2 code":"WF","Alpha-3 code":"WLF","Numeric":"876"},{"English short name":"Western Sahara*","French short name":"Sahara occidental (le)*","Alpha-2 code":"EH","Alpha-3 code":"ESH","Numeric":"732"},{"English short name":"Yemen","French short name":"Yémen (le)","Alpha-2 code":"YE","Alpha-3 code":"YEM","Numeric":"887"},{"English short name":"Zambia","French short name":"Zambie (la)","Alpha-2 code":"ZM","Alpha-3 code":"ZMB","Numeric":"894"},{"English short name":"Zimbabwe","French short name":"Zimbabwe (le)","Alpha-2 code":"ZW","Alpha-3 code":"ZWE","Numeric":"716"},{"English short name":"Åland Islands","French short name":"Åland(les Îles)","Alpha-2 code":"AX","Alpha-3 code":"ALA","Numeric":"248"}] diff --git a/country/alpha2.go b/country/alpha2.go new file mode 100644 index 0000000..0f48735 --- /dev/null +++ b/country/alpha2.go @@ -0,0 +1,57 @@ +package country + +import ( + "database/sql/driver" + "encoding/json" +) + +// Alpha2Code represents alpha-2 code +type Alpha2Code string + +// UnmarshalJSON unmarshall implementation for alpha2code +func (code *Alpha2Code) UnmarshalJSON(data []byte) error { + var str string + if err := json.Unmarshal(data, &str); err != nil { + return err + } + + enumValue := Alpha2Code(str) + if _, err := ByAlpha2CodeErr(enumValue); err != nil { + return err + } + + *code = enumValue + return nil +} + +// Value implementation of driver.Valuer +func (code Alpha2Code) Value() (value driver.Value, err error) { + if code == "" { + return "", nil + } + + var country Country + + if country, err = ByAlpha2CodeErr(code); err != nil { + return nil, err + } + + return country.Alpha2Code().String(), nil +} + +// Validate implementation of ozzo-validation Validate interface +func (code Alpha2Code) Validate() (err error) { + _, err = ByAlpha2CodeErr(code) + + return +} + +// IsSet indicates if Name is set +func (code Alpha2Code) IsSet() bool { + return len(string(code)) > 0 +} + +// String implementation of Stringer interface +func (code Alpha2Code) String() string { + return string(code) +} diff --git a/country/alpha2/alpha_2_gen.go b/country/alpha2/alpha_2_gen.go new file mode 100644 index 0000000..1e14ccf --- /dev/null +++ b/country/alpha2/alpha_2_gen.go @@ -0,0 +1,504 @@ +package alpha2 + +import "github.com/mikekonan/go-types/v2/country" + +const ( + // AF represents 'AF' country alpha-2 code + AF = country.Alpha2Code("AF") + // AL represents 'AL' country alpha-2 code + AL = country.Alpha2Code("AL") + // DZ represents 'DZ' country alpha-2 code + DZ = country.Alpha2Code("DZ") + // AS represents 'AS' country alpha-2 code + AS = country.Alpha2Code("AS") + // AD represents 'AD' country alpha-2 code + AD = country.Alpha2Code("AD") + // AO represents 'AO' country alpha-2 code + AO = country.Alpha2Code("AO") + // AI represents 'AI' country alpha-2 code + AI = country.Alpha2Code("AI") + // AQ represents 'AQ' country alpha-2 code + AQ = country.Alpha2Code("AQ") + // AG represents 'AG' country alpha-2 code + AG = country.Alpha2Code("AG") + // AR represents 'AR' country alpha-2 code + AR = country.Alpha2Code("AR") + // AM represents 'AM' country alpha-2 code + AM = country.Alpha2Code("AM") + // AW represents 'AW' country alpha-2 code + AW = country.Alpha2Code("AW") + // AU represents 'AU' country alpha-2 code + AU = country.Alpha2Code("AU") + // AT represents 'AT' country alpha-2 code + AT = country.Alpha2Code("AT") + // AZ represents 'AZ' country alpha-2 code + AZ = country.Alpha2Code("AZ") + // BS represents 'BS' country alpha-2 code + BS = country.Alpha2Code("BS") + // BH represents 'BH' country alpha-2 code + BH = country.Alpha2Code("BH") + // BD represents 'BD' country alpha-2 code + BD = country.Alpha2Code("BD") + // BB represents 'BB' country alpha-2 code + BB = country.Alpha2Code("BB") + // BY represents 'BY' country alpha-2 code + BY = country.Alpha2Code("BY") + // BE represents 'BE' country alpha-2 code + BE = country.Alpha2Code("BE") + // BZ represents 'BZ' country alpha-2 code + BZ = country.Alpha2Code("BZ") + // BJ represents 'BJ' country alpha-2 code + BJ = country.Alpha2Code("BJ") + // BM represents 'BM' country alpha-2 code + BM = country.Alpha2Code("BM") + // BT represents 'BT' country alpha-2 code + BT = country.Alpha2Code("BT") + // BO represents 'BO' country alpha-2 code + BO = country.Alpha2Code("BO") + // BQ represents 'BQ' country alpha-2 code + BQ = country.Alpha2Code("BQ") + // BA represents 'BA' country alpha-2 code + BA = country.Alpha2Code("BA") + // BW represents 'BW' country alpha-2 code + BW = country.Alpha2Code("BW") + // BV represents 'BV' country alpha-2 code + BV = country.Alpha2Code("BV") + // BR represents 'BR' country alpha-2 code + BR = country.Alpha2Code("BR") + // IO represents 'IO' country alpha-2 code + IO = country.Alpha2Code("IO") + // BN represents 'BN' country alpha-2 code + BN = country.Alpha2Code("BN") + // BG represents 'BG' country alpha-2 code + BG = country.Alpha2Code("BG") + // BF represents 'BF' country alpha-2 code + BF = country.Alpha2Code("BF") + // BI represents 'BI' country alpha-2 code + BI = country.Alpha2Code("BI") + // CV represents 'CV' country alpha-2 code + CV = country.Alpha2Code("CV") + // KH represents 'KH' country alpha-2 code + KH = country.Alpha2Code("KH") + // CM represents 'CM' country alpha-2 code + CM = country.Alpha2Code("CM") + // CA represents 'CA' country alpha-2 code + CA = country.Alpha2Code("CA") + // KY represents 'KY' country alpha-2 code + KY = country.Alpha2Code("KY") + // CF represents 'CF' country alpha-2 code + CF = country.Alpha2Code("CF") + // TD represents 'TD' country alpha-2 code + TD = country.Alpha2Code("TD") + // CL represents 'CL' country alpha-2 code + CL = country.Alpha2Code("CL") + // CN represents 'CN' country alpha-2 code + CN = country.Alpha2Code("CN") + // CX represents 'CX' country alpha-2 code + CX = country.Alpha2Code("CX") + // CC represents 'CC' country alpha-2 code + CC = country.Alpha2Code("CC") + // CO represents 'CO' country alpha-2 code + CO = country.Alpha2Code("CO") + // KM represents 'KM' country alpha-2 code + KM = country.Alpha2Code("KM") + // CD represents 'CD' country alpha-2 code + CD = country.Alpha2Code("CD") + // CG represents 'CG' country alpha-2 code + CG = country.Alpha2Code("CG") + // CK represents 'CK' country alpha-2 code + CK = country.Alpha2Code("CK") + // CR represents 'CR' country alpha-2 code + CR = country.Alpha2Code("CR") + // HR represents 'HR' country alpha-2 code + HR = country.Alpha2Code("HR") + // CU represents 'CU' country alpha-2 code + CU = country.Alpha2Code("CU") + // CW represents 'CW' country alpha-2 code + CW = country.Alpha2Code("CW") + // CY represents 'CY' country alpha-2 code + CY = country.Alpha2Code("CY") + // CZ represents 'CZ' country alpha-2 code + CZ = country.Alpha2Code("CZ") + // CI represents 'CI' country alpha-2 code + CI = country.Alpha2Code("CI") + // DK represents 'DK' country alpha-2 code + DK = country.Alpha2Code("DK") + // DJ represents 'DJ' country alpha-2 code + DJ = country.Alpha2Code("DJ") + // DM represents 'DM' country alpha-2 code + DM = country.Alpha2Code("DM") + // DO represents 'DO' country alpha-2 code + DO = country.Alpha2Code("DO") + // EC represents 'EC' country alpha-2 code + EC = country.Alpha2Code("EC") + // EG represents 'EG' country alpha-2 code + EG = country.Alpha2Code("EG") + // SV represents 'SV' country alpha-2 code + SV = country.Alpha2Code("SV") + // GQ represents 'GQ' country alpha-2 code + GQ = country.Alpha2Code("GQ") + // ER represents 'ER' country alpha-2 code + ER = country.Alpha2Code("ER") + // EE represents 'EE' country alpha-2 code + EE = country.Alpha2Code("EE") + // SZ represents 'SZ' country alpha-2 code + SZ = country.Alpha2Code("SZ") + // ET represents 'ET' country alpha-2 code + ET = country.Alpha2Code("ET") + // FK represents 'FK' country alpha-2 code + FK = country.Alpha2Code("FK") + // FO represents 'FO' country alpha-2 code + FO = country.Alpha2Code("FO") + // FJ represents 'FJ' country alpha-2 code + FJ = country.Alpha2Code("FJ") + // FI represents 'FI' country alpha-2 code + FI = country.Alpha2Code("FI") + // FR represents 'FR' country alpha-2 code + FR = country.Alpha2Code("FR") + // GF represents 'GF' country alpha-2 code + GF = country.Alpha2Code("GF") + // PF represents 'PF' country alpha-2 code + PF = country.Alpha2Code("PF") + // TF represents 'TF' country alpha-2 code + TF = country.Alpha2Code("TF") + // GA represents 'GA' country alpha-2 code + GA = country.Alpha2Code("GA") + // GM represents 'GM' country alpha-2 code + GM = country.Alpha2Code("GM") + // GE represents 'GE' country alpha-2 code + GE = country.Alpha2Code("GE") + // DE represents 'DE' country alpha-2 code + DE = country.Alpha2Code("DE") + // GH represents 'GH' country alpha-2 code + GH = country.Alpha2Code("GH") + // GI represents 'GI' country alpha-2 code + GI = country.Alpha2Code("GI") + // GR represents 'GR' country alpha-2 code + GR = country.Alpha2Code("GR") + // GL represents 'GL' country alpha-2 code + GL = country.Alpha2Code("GL") + // GD represents 'GD' country alpha-2 code + GD = country.Alpha2Code("GD") + // GP represents 'GP' country alpha-2 code + GP = country.Alpha2Code("GP") + // GU represents 'GU' country alpha-2 code + GU = country.Alpha2Code("GU") + // GT represents 'GT' country alpha-2 code + GT = country.Alpha2Code("GT") + // GG represents 'GG' country alpha-2 code + GG = country.Alpha2Code("GG") + // GN represents 'GN' country alpha-2 code + GN = country.Alpha2Code("GN") + // GW represents 'GW' country alpha-2 code + GW = country.Alpha2Code("GW") + // GY represents 'GY' country alpha-2 code + GY = country.Alpha2Code("GY") + // HT represents 'HT' country alpha-2 code + HT = country.Alpha2Code("HT") + // HM represents 'HM' country alpha-2 code + HM = country.Alpha2Code("HM") + // VA represents 'VA' country alpha-2 code + VA = country.Alpha2Code("VA") + // HN represents 'HN' country alpha-2 code + HN = country.Alpha2Code("HN") + // HK represents 'HK' country alpha-2 code + HK = country.Alpha2Code("HK") + // HU represents 'HU' country alpha-2 code + HU = country.Alpha2Code("HU") + // IS represents 'IS' country alpha-2 code + IS = country.Alpha2Code("IS") + // IN represents 'IN' country alpha-2 code + IN = country.Alpha2Code("IN") + // ID represents 'ID' country alpha-2 code + ID = country.Alpha2Code("ID") + // IR represents 'IR' country alpha-2 code + IR = country.Alpha2Code("IR") + // IQ represents 'IQ' country alpha-2 code + IQ = country.Alpha2Code("IQ") + // IE represents 'IE' country alpha-2 code + IE = country.Alpha2Code("IE") + // IM represents 'IM' country alpha-2 code + IM = country.Alpha2Code("IM") + // IL represents 'IL' country alpha-2 code + IL = country.Alpha2Code("IL") + // IT represents 'IT' country alpha-2 code + IT = country.Alpha2Code("IT") + // JM represents 'JM' country alpha-2 code + JM = country.Alpha2Code("JM") + // JP represents 'JP' country alpha-2 code + JP = country.Alpha2Code("JP") + // JE represents 'JE' country alpha-2 code + JE = country.Alpha2Code("JE") + // JO represents 'JO' country alpha-2 code + JO = country.Alpha2Code("JO") + // KZ represents 'KZ' country alpha-2 code + KZ = country.Alpha2Code("KZ") + // KE represents 'KE' country alpha-2 code + KE = country.Alpha2Code("KE") + // KI represents 'KI' country alpha-2 code + KI = country.Alpha2Code("KI") + // KP represents 'KP' country alpha-2 code + KP = country.Alpha2Code("KP") + // KR represents 'KR' country alpha-2 code + KR = country.Alpha2Code("KR") + // KW represents 'KW' country alpha-2 code + KW = country.Alpha2Code("KW") + // KG represents 'KG' country alpha-2 code + KG = country.Alpha2Code("KG") + // LA represents 'LA' country alpha-2 code + LA = country.Alpha2Code("LA") + // LV represents 'LV' country alpha-2 code + LV = country.Alpha2Code("LV") + // LB represents 'LB' country alpha-2 code + LB = country.Alpha2Code("LB") + // LS represents 'LS' country alpha-2 code + LS = country.Alpha2Code("LS") + // LR represents 'LR' country alpha-2 code + LR = country.Alpha2Code("LR") + // LY represents 'LY' country alpha-2 code + LY = country.Alpha2Code("LY") + // LI represents 'LI' country alpha-2 code + LI = country.Alpha2Code("LI") + // LT represents 'LT' country alpha-2 code + LT = country.Alpha2Code("LT") + // LU represents 'LU' country alpha-2 code + LU = country.Alpha2Code("LU") + // MO represents 'MO' country alpha-2 code + MO = country.Alpha2Code("MO") + // MG represents 'MG' country alpha-2 code + MG = country.Alpha2Code("MG") + // MW represents 'MW' country alpha-2 code + MW = country.Alpha2Code("MW") + // MY represents 'MY' country alpha-2 code + MY = country.Alpha2Code("MY") + // MV represents 'MV' country alpha-2 code + MV = country.Alpha2Code("MV") + // ML represents 'ML' country alpha-2 code + ML = country.Alpha2Code("ML") + // MT represents 'MT' country alpha-2 code + MT = country.Alpha2Code("MT") + // MH represents 'MH' country alpha-2 code + MH = country.Alpha2Code("MH") + // MQ represents 'MQ' country alpha-2 code + MQ = country.Alpha2Code("MQ") + // MR represents 'MR' country alpha-2 code + MR = country.Alpha2Code("MR") + // MU represents 'MU' country alpha-2 code + MU = country.Alpha2Code("MU") + // YT represents 'YT' country alpha-2 code + YT = country.Alpha2Code("YT") + // MX represents 'MX' country alpha-2 code + MX = country.Alpha2Code("MX") + // FM represents 'FM' country alpha-2 code + FM = country.Alpha2Code("FM") + // MD represents 'MD' country alpha-2 code + MD = country.Alpha2Code("MD") + // MC represents 'MC' country alpha-2 code + MC = country.Alpha2Code("MC") + // MN represents 'MN' country alpha-2 code + MN = country.Alpha2Code("MN") + // ME represents 'ME' country alpha-2 code + ME = country.Alpha2Code("ME") + // MS represents 'MS' country alpha-2 code + MS = country.Alpha2Code("MS") + // MA represents 'MA' country alpha-2 code + MA = country.Alpha2Code("MA") + // MZ represents 'MZ' country alpha-2 code + MZ = country.Alpha2Code("MZ") + // MM represents 'MM' country alpha-2 code + MM = country.Alpha2Code("MM") + // NA represents 'NA' country alpha-2 code + NA = country.Alpha2Code("NA") + // NR represents 'NR' country alpha-2 code + NR = country.Alpha2Code("NR") + // NP represents 'NP' country alpha-2 code + NP = country.Alpha2Code("NP") + // NL represents 'NL' country alpha-2 code + NL = country.Alpha2Code("NL") + // NC represents 'NC' country alpha-2 code + NC = country.Alpha2Code("NC") + // NZ represents 'NZ' country alpha-2 code + NZ = country.Alpha2Code("NZ") + // NI represents 'NI' country alpha-2 code + NI = country.Alpha2Code("NI") + // NE represents 'NE' country alpha-2 code + NE = country.Alpha2Code("NE") + // NG represents 'NG' country alpha-2 code + NG = country.Alpha2Code("NG") + // NU represents 'NU' country alpha-2 code + NU = country.Alpha2Code("NU") + // NF represents 'NF' country alpha-2 code + NF = country.Alpha2Code("NF") + // MK represents 'MK' country alpha-2 code + MK = country.Alpha2Code("MK") + // MP represents 'MP' country alpha-2 code + MP = country.Alpha2Code("MP") + // NO represents 'NO' country alpha-2 code + NO = country.Alpha2Code("NO") + // OM represents 'OM' country alpha-2 code + OM = country.Alpha2Code("OM") + // PK represents 'PK' country alpha-2 code + PK = country.Alpha2Code("PK") + // PW represents 'PW' country alpha-2 code + PW = country.Alpha2Code("PW") + // PS represents 'PS' country alpha-2 code + PS = country.Alpha2Code("PS") + // PA represents 'PA' country alpha-2 code + PA = country.Alpha2Code("PA") + // PG represents 'PG' country alpha-2 code + PG = country.Alpha2Code("PG") + // PY represents 'PY' country alpha-2 code + PY = country.Alpha2Code("PY") + // PE represents 'PE' country alpha-2 code + PE = country.Alpha2Code("PE") + // PH represents 'PH' country alpha-2 code + PH = country.Alpha2Code("PH") + // PN represents 'PN' country alpha-2 code + PN = country.Alpha2Code("PN") + // PL represents 'PL' country alpha-2 code + PL = country.Alpha2Code("PL") + // PT represents 'PT' country alpha-2 code + PT = country.Alpha2Code("PT") + // PR represents 'PR' country alpha-2 code + PR = country.Alpha2Code("PR") + // QA represents 'QA' country alpha-2 code + QA = country.Alpha2Code("QA") + // RO represents 'RO' country alpha-2 code + RO = country.Alpha2Code("RO") + // RU represents 'RU' country alpha-2 code + RU = country.Alpha2Code("RU") + // RW represents 'RW' country alpha-2 code + RW = country.Alpha2Code("RW") + // RE represents 'RE' country alpha-2 code + RE = country.Alpha2Code("RE") + // BL represents 'BL' country alpha-2 code + BL = country.Alpha2Code("BL") + // SH represents 'SH' country alpha-2 code + SH = country.Alpha2Code("SH") + // KN represents 'KN' country alpha-2 code + KN = country.Alpha2Code("KN") + // LC represents 'LC' country alpha-2 code + LC = country.Alpha2Code("LC") + // MF represents 'MF' country alpha-2 code + MF = country.Alpha2Code("MF") + // PM represents 'PM' country alpha-2 code + PM = country.Alpha2Code("PM") + // VC represents 'VC' country alpha-2 code + VC = country.Alpha2Code("VC") + // WS represents 'WS' country alpha-2 code + WS = country.Alpha2Code("WS") + // SM represents 'SM' country alpha-2 code + SM = country.Alpha2Code("SM") + // ST represents 'ST' country alpha-2 code + ST = country.Alpha2Code("ST") + // SA represents 'SA' country alpha-2 code + SA = country.Alpha2Code("SA") + // SN represents 'SN' country alpha-2 code + SN = country.Alpha2Code("SN") + // RS represents 'RS' country alpha-2 code + RS = country.Alpha2Code("RS") + // SC represents 'SC' country alpha-2 code + SC = country.Alpha2Code("SC") + // SL represents 'SL' country alpha-2 code + SL = country.Alpha2Code("SL") + // SG represents 'SG' country alpha-2 code + SG = country.Alpha2Code("SG") + // SX represents 'SX' country alpha-2 code + SX = country.Alpha2Code("SX") + // SK represents 'SK' country alpha-2 code + SK = country.Alpha2Code("SK") + // SI represents 'SI' country alpha-2 code + SI = country.Alpha2Code("SI") + // SB represents 'SB' country alpha-2 code + SB = country.Alpha2Code("SB") + // SO represents 'SO' country alpha-2 code + SO = country.Alpha2Code("SO") + // ZA represents 'ZA' country alpha-2 code + ZA = country.Alpha2Code("ZA") + // GS represents 'GS' country alpha-2 code + GS = country.Alpha2Code("GS") + // SS represents 'SS' country alpha-2 code + SS = country.Alpha2Code("SS") + // ES represents 'ES' country alpha-2 code + ES = country.Alpha2Code("ES") + // LK represents 'LK' country alpha-2 code + LK = country.Alpha2Code("LK") + // SD represents 'SD' country alpha-2 code + SD = country.Alpha2Code("SD") + // SR represents 'SR' country alpha-2 code + SR = country.Alpha2Code("SR") + // SJ represents 'SJ' country alpha-2 code + SJ = country.Alpha2Code("SJ") + // SE represents 'SE' country alpha-2 code + SE = country.Alpha2Code("SE") + // CH represents 'CH' country alpha-2 code + CH = country.Alpha2Code("CH") + // SY represents 'SY' country alpha-2 code + SY = country.Alpha2Code("SY") + // TW represents 'TW' country alpha-2 code + TW = country.Alpha2Code("TW") + // TJ represents 'TJ' country alpha-2 code + TJ = country.Alpha2Code("TJ") + // TZ represents 'TZ' country alpha-2 code + TZ = country.Alpha2Code("TZ") + // TH represents 'TH' country alpha-2 code + TH = country.Alpha2Code("TH") + // TL represents 'TL' country alpha-2 code + TL = country.Alpha2Code("TL") + // TG represents 'TG' country alpha-2 code + TG = country.Alpha2Code("TG") + // TK represents 'TK' country alpha-2 code + TK = country.Alpha2Code("TK") + // TO represents 'TO' country alpha-2 code + TO = country.Alpha2Code("TO") + // TT represents 'TT' country alpha-2 code + TT = country.Alpha2Code("TT") + // TN represents 'TN' country alpha-2 code + TN = country.Alpha2Code("TN") + // TM represents 'TM' country alpha-2 code + TM = country.Alpha2Code("TM") + // TC represents 'TC' country alpha-2 code + TC = country.Alpha2Code("TC") + // TV represents 'TV' country alpha-2 code + TV = country.Alpha2Code("TV") + // TR represents 'TR' country alpha-2 code + TR = country.Alpha2Code("TR") + // UG represents 'UG' country alpha-2 code + UG = country.Alpha2Code("UG") + // UA represents 'UA' country alpha-2 code + UA = country.Alpha2Code("UA") + // AE represents 'AE' country alpha-2 code + AE = country.Alpha2Code("AE") + // GB represents 'GB' country alpha-2 code + GB = country.Alpha2Code("GB") + // UM represents 'UM' country alpha-2 code + UM = country.Alpha2Code("UM") + // US represents 'US' country alpha-2 code + US = country.Alpha2Code("US") + // UY represents 'UY' country alpha-2 code + UY = country.Alpha2Code("UY") + // UZ represents 'UZ' country alpha-2 code + UZ = country.Alpha2Code("UZ") + // VU represents 'VU' country alpha-2 code + VU = country.Alpha2Code("VU") + // VE represents 'VE' country alpha-2 code + VE = country.Alpha2Code("VE") + // VN represents 'VN' country alpha-2 code + VN = country.Alpha2Code("VN") + // VG represents 'VG' country alpha-2 code + VG = country.Alpha2Code("VG") + // VI represents 'VI' country alpha-2 code + VI = country.Alpha2Code("VI") + // WF represents 'WF' country alpha-2 code + WF = country.Alpha2Code("WF") + // EH represents 'EH' country alpha-2 code + EH = country.Alpha2Code("EH") + // YE represents 'YE' country alpha-2 code + YE = country.Alpha2Code("YE") + // ZM represents 'ZM' country alpha-2 code + ZM = country.Alpha2Code("ZM") + // ZW represents 'ZW' country alpha-2 code + ZW = country.Alpha2Code("ZW") + // AX represents 'AX' country alpha-2 code + AX = country.Alpha2Code("AX") +) diff --git a/country/alpha2_gen.go b/country/alpha2_gen.go deleted file mode 100644 index 96749dd..0000000 --- a/country/alpha2_gen.go +++ /dev/null @@ -1,502 +0,0 @@ -package country - -const ( - //Alpha2AF represents 'AF' country alpha-2 code - Alpha2AF = Alpha2Code("AF") - //Alpha2AL represents 'AL' country alpha-2 code - Alpha2AL = Alpha2Code("AL") - //Alpha2DZ represents 'DZ' country alpha-2 code - Alpha2DZ = Alpha2Code("DZ") - //Alpha2AS represents 'AS' country alpha-2 code - Alpha2AS = Alpha2Code("AS") - //Alpha2AD represents 'AD' country alpha-2 code - Alpha2AD = Alpha2Code("AD") - //Alpha2AO represents 'AO' country alpha-2 code - Alpha2AO = Alpha2Code("AO") - //Alpha2AI represents 'AI' country alpha-2 code - Alpha2AI = Alpha2Code("AI") - //Alpha2AQ represents 'AQ' country alpha-2 code - Alpha2AQ = Alpha2Code("AQ") - //Alpha2AG represents 'AG' country alpha-2 code - Alpha2AG = Alpha2Code("AG") - //Alpha2AR represents 'AR' country alpha-2 code - Alpha2AR = Alpha2Code("AR") - //Alpha2AM represents 'AM' country alpha-2 code - Alpha2AM = Alpha2Code("AM") - //Alpha2AW represents 'AW' country alpha-2 code - Alpha2AW = Alpha2Code("AW") - //Alpha2AU represents 'AU' country alpha-2 code - Alpha2AU = Alpha2Code("AU") - //Alpha2AT represents 'AT' country alpha-2 code - Alpha2AT = Alpha2Code("AT") - //Alpha2AZ represents 'AZ' country alpha-2 code - Alpha2AZ = Alpha2Code("AZ") - //Alpha2BS represents 'BS' country alpha-2 code - Alpha2BS = Alpha2Code("BS") - //Alpha2BH represents 'BH' country alpha-2 code - Alpha2BH = Alpha2Code("BH") - //Alpha2BD represents 'BD' country alpha-2 code - Alpha2BD = Alpha2Code("BD") - //Alpha2BB represents 'BB' country alpha-2 code - Alpha2BB = Alpha2Code("BB") - //Alpha2BY represents 'BY' country alpha-2 code - Alpha2BY = Alpha2Code("BY") - //Alpha2BE represents 'BE' country alpha-2 code - Alpha2BE = Alpha2Code("BE") - //Alpha2BZ represents 'BZ' country alpha-2 code - Alpha2BZ = Alpha2Code("BZ") - //Alpha2BJ represents 'BJ' country alpha-2 code - Alpha2BJ = Alpha2Code("BJ") - //Alpha2BM represents 'BM' country alpha-2 code - Alpha2BM = Alpha2Code("BM") - //Alpha2BT represents 'BT' country alpha-2 code - Alpha2BT = Alpha2Code("BT") - //Alpha2BO represents 'BO' country alpha-2 code - Alpha2BO = Alpha2Code("BO") - //Alpha2BQ represents 'BQ' country alpha-2 code - Alpha2BQ = Alpha2Code("BQ") - //Alpha2BA represents 'BA' country alpha-2 code - Alpha2BA = Alpha2Code("BA") - //Alpha2BW represents 'BW' country alpha-2 code - Alpha2BW = Alpha2Code("BW") - //Alpha2BV represents 'BV' country alpha-2 code - Alpha2BV = Alpha2Code("BV") - //Alpha2BR represents 'BR' country alpha-2 code - Alpha2BR = Alpha2Code("BR") - //Alpha2IO represents 'IO' country alpha-2 code - Alpha2IO = Alpha2Code("IO") - //Alpha2BN represents 'BN' country alpha-2 code - Alpha2BN = Alpha2Code("BN") - //Alpha2BG represents 'BG' country alpha-2 code - Alpha2BG = Alpha2Code("BG") - //Alpha2BF represents 'BF' country alpha-2 code - Alpha2BF = Alpha2Code("BF") - //Alpha2BI represents 'BI' country alpha-2 code - Alpha2BI = Alpha2Code("BI") - //Alpha2CV represents 'CV' country alpha-2 code - Alpha2CV = Alpha2Code("CV") - //Alpha2KH represents 'KH' country alpha-2 code - Alpha2KH = Alpha2Code("KH") - //Alpha2CM represents 'CM' country alpha-2 code - Alpha2CM = Alpha2Code("CM") - //Alpha2CA represents 'CA' country alpha-2 code - Alpha2CA = Alpha2Code("CA") - //Alpha2KY represents 'KY' country alpha-2 code - Alpha2KY = Alpha2Code("KY") - //Alpha2CF represents 'CF' country alpha-2 code - Alpha2CF = Alpha2Code("CF") - //Alpha2TD represents 'TD' country alpha-2 code - Alpha2TD = Alpha2Code("TD") - //Alpha2CL represents 'CL' country alpha-2 code - Alpha2CL = Alpha2Code("CL") - //Alpha2CN represents 'CN' country alpha-2 code - Alpha2CN = Alpha2Code("CN") - //Alpha2CX represents 'CX' country alpha-2 code - Alpha2CX = Alpha2Code("CX") - //Alpha2CC represents 'CC' country alpha-2 code - Alpha2CC = Alpha2Code("CC") - //Alpha2CO represents 'CO' country alpha-2 code - Alpha2CO = Alpha2Code("CO") - //Alpha2KM represents 'KM' country alpha-2 code - Alpha2KM = Alpha2Code("KM") - //Alpha2CD represents 'CD' country alpha-2 code - Alpha2CD = Alpha2Code("CD") - //Alpha2CG represents 'CG' country alpha-2 code - Alpha2CG = Alpha2Code("CG") - //Alpha2CK represents 'CK' country alpha-2 code - Alpha2CK = Alpha2Code("CK") - //Alpha2CR represents 'CR' country alpha-2 code - Alpha2CR = Alpha2Code("CR") - //Alpha2HR represents 'HR' country alpha-2 code - Alpha2HR = Alpha2Code("HR") - //Alpha2CU represents 'CU' country alpha-2 code - Alpha2CU = Alpha2Code("CU") - //Alpha2CW represents 'CW' country alpha-2 code - Alpha2CW = Alpha2Code("CW") - //Alpha2CY represents 'CY' country alpha-2 code - Alpha2CY = Alpha2Code("CY") - //Alpha2CZ represents 'CZ' country alpha-2 code - Alpha2CZ = Alpha2Code("CZ") - //Alpha2CI represents 'CI' country alpha-2 code - Alpha2CI = Alpha2Code("CI") - //Alpha2DK represents 'DK' country alpha-2 code - Alpha2DK = Alpha2Code("DK") - //Alpha2DJ represents 'DJ' country alpha-2 code - Alpha2DJ = Alpha2Code("DJ") - //Alpha2DM represents 'DM' country alpha-2 code - Alpha2DM = Alpha2Code("DM") - //Alpha2DO represents 'DO' country alpha-2 code - Alpha2DO = Alpha2Code("DO") - //Alpha2EC represents 'EC' country alpha-2 code - Alpha2EC = Alpha2Code("EC") - //Alpha2EG represents 'EG' country alpha-2 code - Alpha2EG = Alpha2Code("EG") - //Alpha2SV represents 'SV' country alpha-2 code - Alpha2SV = Alpha2Code("SV") - //Alpha2GQ represents 'GQ' country alpha-2 code - Alpha2GQ = Alpha2Code("GQ") - //Alpha2ER represents 'ER' country alpha-2 code - Alpha2ER = Alpha2Code("ER") - //Alpha2EE represents 'EE' country alpha-2 code - Alpha2EE = Alpha2Code("EE") - //Alpha2SZ represents 'SZ' country alpha-2 code - Alpha2SZ = Alpha2Code("SZ") - //Alpha2ET represents 'ET' country alpha-2 code - Alpha2ET = Alpha2Code("ET") - //Alpha2FK represents 'FK' country alpha-2 code - Alpha2FK = Alpha2Code("FK") - //Alpha2FO represents 'FO' country alpha-2 code - Alpha2FO = Alpha2Code("FO") - //Alpha2FJ represents 'FJ' country alpha-2 code - Alpha2FJ = Alpha2Code("FJ") - //Alpha2FI represents 'FI' country alpha-2 code - Alpha2FI = Alpha2Code("FI") - //Alpha2FR represents 'FR' country alpha-2 code - Alpha2FR = Alpha2Code("FR") - //Alpha2GF represents 'GF' country alpha-2 code - Alpha2GF = Alpha2Code("GF") - //Alpha2PF represents 'PF' country alpha-2 code - Alpha2PF = Alpha2Code("PF") - //Alpha2TF represents 'TF' country alpha-2 code - Alpha2TF = Alpha2Code("TF") - //Alpha2GA represents 'GA' country alpha-2 code - Alpha2GA = Alpha2Code("GA") - //Alpha2GM represents 'GM' country alpha-2 code - Alpha2GM = Alpha2Code("GM") - //Alpha2GE represents 'GE' country alpha-2 code - Alpha2GE = Alpha2Code("GE") - //Alpha2DE represents 'DE' country alpha-2 code - Alpha2DE = Alpha2Code("DE") - //Alpha2GH represents 'GH' country alpha-2 code - Alpha2GH = Alpha2Code("GH") - //Alpha2GI represents 'GI' country alpha-2 code - Alpha2GI = Alpha2Code("GI") - //Alpha2GR represents 'GR' country alpha-2 code - Alpha2GR = Alpha2Code("GR") - //Alpha2GL represents 'GL' country alpha-2 code - Alpha2GL = Alpha2Code("GL") - //Alpha2GD represents 'GD' country alpha-2 code - Alpha2GD = Alpha2Code("GD") - //Alpha2GP represents 'GP' country alpha-2 code - Alpha2GP = Alpha2Code("GP") - //Alpha2GU represents 'GU' country alpha-2 code - Alpha2GU = Alpha2Code("GU") - //Alpha2GT represents 'GT' country alpha-2 code - Alpha2GT = Alpha2Code("GT") - //Alpha2GG represents 'GG' country alpha-2 code - Alpha2GG = Alpha2Code("GG") - //Alpha2GN represents 'GN' country alpha-2 code - Alpha2GN = Alpha2Code("GN") - //Alpha2GW represents 'GW' country alpha-2 code - Alpha2GW = Alpha2Code("GW") - //Alpha2GY represents 'GY' country alpha-2 code - Alpha2GY = Alpha2Code("GY") - //Alpha2HT represents 'HT' country alpha-2 code - Alpha2HT = Alpha2Code("HT") - //Alpha2HM represents 'HM' country alpha-2 code - Alpha2HM = Alpha2Code("HM") - //Alpha2VA represents 'VA' country alpha-2 code - Alpha2VA = Alpha2Code("VA") - //Alpha2HN represents 'HN' country alpha-2 code - Alpha2HN = Alpha2Code("HN") - //Alpha2HK represents 'HK' country alpha-2 code - Alpha2HK = Alpha2Code("HK") - //Alpha2HU represents 'HU' country alpha-2 code - Alpha2HU = Alpha2Code("HU") - //Alpha2IS represents 'IS' country alpha-2 code - Alpha2IS = Alpha2Code("IS") - //Alpha2IN represents 'IN' country alpha-2 code - Alpha2IN = Alpha2Code("IN") - //Alpha2ID represents 'ID' country alpha-2 code - Alpha2ID = Alpha2Code("ID") - //Alpha2IR represents 'IR' country alpha-2 code - Alpha2IR = Alpha2Code("IR") - //Alpha2IQ represents 'IQ' country alpha-2 code - Alpha2IQ = Alpha2Code("IQ") - //Alpha2IE represents 'IE' country alpha-2 code - Alpha2IE = Alpha2Code("IE") - //Alpha2IM represents 'IM' country alpha-2 code - Alpha2IM = Alpha2Code("IM") - //Alpha2IL represents 'IL' country alpha-2 code - Alpha2IL = Alpha2Code("IL") - //Alpha2IT represents 'IT' country alpha-2 code - Alpha2IT = Alpha2Code("IT") - //Alpha2JM represents 'JM' country alpha-2 code - Alpha2JM = Alpha2Code("JM") - //Alpha2JP represents 'JP' country alpha-2 code - Alpha2JP = Alpha2Code("JP") - //Alpha2JE represents 'JE' country alpha-2 code - Alpha2JE = Alpha2Code("JE") - //Alpha2JO represents 'JO' country alpha-2 code - Alpha2JO = Alpha2Code("JO") - //Alpha2KZ represents 'KZ' country alpha-2 code - Alpha2KZ = Alpha2Code("KZ") - //Alpha2KE represents 'KE' country alpha-2 code - Alpha2KE = Alpha2Code("KE") - //Alpha2KI represents 'KI' country alpha-2 code - Alpha2KI = Alpha2Code("KI") - //Alpha2KP represents 'KP' country alpha-2 code - Alpha2KP = Alpha2Code("KP") - //Alpha2KR represents 'KR' country alpha-2 code - Alpha2KR = Alpha2Code("KR") - //Alpha2KW represents 'KW' country alpha-2 code - Alpha2KW = Alpha2Code("KW") - //Alpha2KG represents 'KG' country alpha-2 code - Alpha2KG = Alpha2Code("KG") - //Alpha2LA represents 'LA' country alpha-2 code - Alpha2LA = Alpha2Code("LA") - //Alpha2LV represents 'LV' country alpha-2 code - Alpha2LV = Alpha2Code("LV") - //Alpha2LB represents 'LB' country alpha-2 code - Alpha2LB = Alpha2Code("LB") - //Alpha2LS represents 'LS' country alpha-2 code - Alpha2LS = Alpha2Code("LS") - //Alpha2LR represents 'LR' country alpha-2 code - Alpha2LR = Alpha2Code("LR") - //Alpha2LY represents 'LY' country alpha-2 code - Alpha2LY = Alpha2Code("LY") - //Alpha2LI represents 'LI' country alpha-2 code - Alpha2LI = Alpha2Code("LI") - //Alpha2LT represents 'LT' country alpha-2 code - Alpha2LT = Alpha2Code("LT") - //Alpha2LU represents 'LU' country alpha-2 code - Alpha2LU = Alpha2Code("LU") - //Alpha2MO represents 'MO' country alpha-2 code - Alpha2MO = Alpha2Code("MO") - //Alpha2MG represents 'MG' country alpha-2 code - Alpha2MG = Alpha2Code("MG") - //Alpha2MW represents 'MW' country alpha-2 code - Alpha2MW = Alpha2Code("MW") - //Alpha2MY represents 'MY' country alpha-2 code - Alpha2MY = Alpha2Code("MY") - //Alpha2MV represents 'MV' country alpha-2 code - Alpha2MV = Alpha2Code("MV") - //Alpha2ML represents 'ML' country alpha-2 code - Alpha2ML = Alpha2Code("ML") - //Alpha2MT represents 'MT' country alpha-2 code - Alpha2MT = Alpha2Code("MT") - //Alpha2MH represents 'MH' country alpha-2 code - Alpha2MH = Alpha2Code("MH") - //Alpha2MQ represents 'MQ' country alpha-2 code - Alpha2MQ = Alpha2Code("MQ") - //Alpha2MR represents 'MR' country alpha-2 code - Alpha2MR = Alpha2Code("MR") - //Alpha2MU represents 'MU' country alpha-2 code - Alpha2MU = Alpha2Code("MU") - //Alpha2YT represents 'YT' country alpha-2 code - Alpha2YT = Alpha2Code("YT") - //Alpha2MX represents 'MX' country alpha-2 code - Alpha2MX = Alpha2Code("MX") - //Alpha2FM represents 'FM' country alpha-2 code - Alpha2FM = Alpha2Code("FM") - //Alpha2MD represents 'MD' country alpha-2 code - Alpha2MD = Alpha2Code("MD") - //Alpha2MC represents 'MC' country alpha-2 code - Alpha2MC = Alpha2Code("MC") - //Alpha2MN represents 'MN' country alpha-2 code - Alpha2MN = Alpha2Code("MN") - //Alpha2ME represents 'ME' country alpha-2 code - Alpha2ME = Alpha2Code("ME") - //Alpha2MS represents 'MS' country alpha-2 code - Alpha2MS = Alpha2Code("MS") - //Alpha2MA represents 'MA' country alpha-2 code - Alpha2MA = Alpha2Code("MA") - //Alpha2MZ represents 'MZ' country alpha-2 code - Alpha2MZ = Alpha2Code("MZ") - //Alpha2MM represents 'MM' country alpha-2 code - Alpha2MM = Alpha2Code("MM") - //Alpha2NA represents 'NA' country alpha-2 code - Alpha2NA = Alpha2Code("NA") - //Alpha2NR represents 'NR' country alpha-2 code - Alpha2NR = Alpha2Code("NR") - //Alpha2NP represents 'NP' country alpha-2 code - Alpha2NP = Alpha2Code("NP") - //Alpha2NL represents 'NL' country alpha-2 code - Alpha2NL = Alpha2Code("NL") - //Alpha2NC represents 'NC' country alpha-2 code - Alpha2NC = Alpha2Code("NC") - //Alpha2NZ represents 'NZ' country alpha-2 code - Alpha2NZ = Alpha2Code("NZ") - //Alpha2NI represents 'NI' country alpha-2 code - Alpha2NI = Alpha2Code("NI") - //Alpha2NE represents 'NE' country alpha-2 code - Alpha2NE = Alpha2Code("NE") - //Alpha2NG represents 'NG' country alpha-2 code - Alpha2NG = Alpha2Code("NG") - //Alpha2NU represents 'NU' country alpha-2 code - Alpha2NU = Alpha2Code("NU") - //Alpha2NF represents 'NF' country alpha-2 code - Alpha2NF = Alpha2Code("NF") - //Alpha2MK represents 'MK' country alpha-2 code - Alpha2MK = Alpha2Code("MK") - //Alpha2MP represents 'MP' country alpha-2 code - Alpha2MP = Alpha2Code("MP") - //Alpha2NO represents 'NO' country alpha-2 code - Alpha2NO = Alpha2Code("NO") - //Alpha2OM represents 'OM' country alpha-2 code - Alpha2OM = Alpha2Code("OM") - //Alpha2PK represents 'PK' country alpha-2 code - Alpha2PK = Alpha2Code("PK") - //Alpha2PW represents 'PW' country alpha-2 code - Alpha2PW = Alpha2Code("PW") - //Alpha2PS represents 'PS' country alpha-2 code - Alpha2PS = Alpha2Code("PS") - //Alpha2PA represents 'PA' country alpha-2 code - Alpha2PA = Alpha2Code("PA") - //Alpha2PG represents 'PG' country alpha-2 code - Alpha2PG = Alpha2Code("PG") - //Alpha2PY represents 'PY' country alpha-2 code - Alpha2PY = Alpha2Code("PY") - //Alpha2PE represents 'PE' country alpha-2 code - Alpha2PE = Alpha2Code("PE") - //Alpha2PH represents 'PH' country alpha-2 code - Alpha2PH = Alpha2Code("PH") - //Alpha2PN represents 'PN' country alpha-2 code - Alpha2PN = Alpha2Code("PN") - //Alpha2PL represents 'PL' country alpha-2 code - Alpha2PL = Alpha2Code("PL") - //Alpha2PT represents 'PT' country alpha-2 code - Alpha2PT = Alpha2Code("PT") - //Alpha2PR represents 'PR' country alpha-2 code - Alpha2PR = Alpha2Code("PR") - //Alpha2QA represents 'QA' country alpha-2 code - Alpha2QA = Alpha2Code("QA") - //Alpha2RO represents 'RO' country alpha-2 code - Alpha2RO = Alpha2Code("RO") - //Alpha2RU represents 'RU' country alpha-2 code - Alpha2RU = Alpha2Code("RU") - //Alpha2RW represents 'RW' country alpha-2 code - Alpha2RW = Alpha2Code("RW") - //Alpha2RE represents 'RE' country alpha-2 code - Alpha2RE = Alpha2Code("RE") - //Alpha2BL represents 'BL' country alpha-2 code - Alpha2BL = Alpha2Code("BL") - //Alpha2SH represents 'SH' country alpha-2 code - Alpha2SH = Alpha2Code("SH") - //Alpha2KN represents 'KN' country alpha-2 code - Alpha2KN = Alpha2Code("KN") - //Alpha2LC represents 'LC' country alpha-2 code - Alpha2LC = Alpha2Code("LC") - //Alpha2MF represents 'MF' country alpha-2 code - Alpha2MF = Alpha2Code("MF") - //Alpha2PM represents 'PM' country alpha-2 code - Alpha2PM = Alpha2Code("PM") - //Alpha2VC represents 'VC' country alpha-2 code - Alpha2VC = Alpha2Code("VC") - //Alpha2WS represents 'WS' country alpha-2 code - Alpha2WS = Alpha2Code("WS") - //Alpha2SM represents 'SM' country alpha-2 code - Alpha2SM = Alpha2Code("SM") - //Alpha2ST represents 'ST' country alpha-2 code - Alpha2ST = Alpha2Code("ST") - //Alpha2SA represents 'SA' country alpha-2 code - Alpha2SA = Alpha2Code("SA") - //Alpha2SN represents 'SN' country alpha-2 code - Alpha2SN = Alpha2Code("SN") - //Alpha2RS represents 'RS' country alpha-2 code - Alpha2RS = Alpha2Code("RS") - //Alpha2SC represents 'SC' country alpha-2 code - Alpha2SC = Alpha2Code("SC") - //Alpha2SL represents 'SL' country alpha-2 code - Alpha2SL = Alpha2Code("SL") - //Alpha2SG represents 'SG' country alpha-2 code - Alpha2SG = Alpha2Code("SG") - //Alpha2SX represents 'SX' country alpha-2 code - Alpha2SX = Alpha2Code("SX") - //Alpha2SK represents 'SK' country alpha-2 code - Alpha2SK = Alpha2Code("SK") - //Alpha2SI represents 'SI' country alpha-2 code - Alpha2SI = Alpha2Code("SI") - //Alpha2SB represents 'SB' country alpha-2 code - Alpha2SB = Alpha2Code("SB") - //Alpha2SO represents 'SO' country alpha-2 code - Alpha2SO = Alpha2Code("SO") - //Alpha2ZA represents 'ZA' country alpha-2 code - Alpha2ZA = Alpha2Code("ZA") - //Alpha2GS represents 'GS' country alpha-2 code - Alpha2GS = Alpha2Code("GS") - //Alpha2SS represents 'SS' country alpha-2 code - Alpha2SS = Alpha2Code("SS") - //Alpha2ES represents 'ES' country alpha-2 code - Alpha2ES = Alpha2Code("ES") - //Alpha2LK represents 'LK' country alpha-2 code - Alpha2LK = Alpha2Code("LK") - //Alpha2SD represents 'SD' country alpha-2 code - Alpha2SD = Alpha2Code("SD") - //Alpha2SR represents 'SR' country alpha-2 code - Alpha2SR = Alpha2Code("SR") - //Alpha2SJ represents 'SJ' country alpha-2 code - Alpha2SJ = Alpha2Code("SJ") - //Alpha2SE represents 'SE' country alpha-2 code - Alpha2SE = Alpha2Code("SE") - //Alpha2CH represents 'CH' country alpha-2 code - Alpha2CH = Alpha2Code("CH") - //Alpha2SY represents 'SY' country alpha-2 code - Alpha2SY = Alpha2Code("SY") - //Alpha2TW represents 'TW' country alpha-2 code - Alpha2TW = Alpha2Code("TW") - //Alpha2TJ represents 'TJ' country alpha-2 code - Alpha2TJ = Alpha2Code("TJ") - //Alpha2TZ represents 'TZ' country alpha-2 code - Alpha2TZ = Alpha2Code("TZ") - //Alpha2TH represents 'TH' country alpha-2 code - Alpha2TH = Alpha2Code("TH") - //Alpha2TL represents 'TL' country alpha-2 code - Alpha2TL = Alpha2Code("TL") - //Alpha2TG represents 'TG' country alpha-2 code - Alpha2TG = Alpha2Code("TG") - //Alpha2TK represents 'TK' country alpha-2 code - Alpha2TK = Alpha2Code("TK") - //Alpha2TO represents 'TO' country alpha-2 code - Alpha2TO = Alpha2Code("TO") - //Alpha2TT represents 'TT' country alpha-2 code - Alpha2TT = Alpha2Code("TT") - //Alpha2TN represents 'TN' country alpha-2 code - Alpha2TN = Alpha2Code("TN") - //Alpha2TR represents 'TR' country alpha-2 code - Alpha2TR = Alpha2Code("TR") - //Alpha2TM represents 'TM' country alpha-2 code - Alpha2TM = Alpha2Code("TM") - //Alpha2TC represents 'TC' country alpha-2 code - Alpha2TC = Alpha2Code("TC") - //Alpha2TV represents 'TV' country alpha-2 code - Alpha2TV = Alpha2Code("TV") - //Alpha2UG represents 'UG' country alpha-2 code - Alpha2UG = Alpha2Code("UG") - //Alpha2UA represents 'UA' country alpha-2 code - Alpha2UA = Alpha2Code("UA") - //Alpha2AE represents 'AE' country alpha-2 code - Alpha2AE = Alpha2Code("AE") - //Alpha2GB represents 'GB' country alpha-2 code - Alpha2GB = Alpha2Code("GB") - //Alpha2UM represents 'UM' country alpha-2 code - Alpha2UM = Alpha2Code("UM") - //Alpha2US represents 'US' country alpha-2 code - Alpha2US = Alpha2Code("US") - //Alpha2UY represents 'UY' country alpha-2 code - Alpha2UY = Alpha2Code("UY") - //Alpha2UZ represents 'UZ' country alpha-2 code - Alpha2UZ = Alpha2Code("UZ") - //Alpha2VU represents 'VU' country alpha-2 code - Alpha2VU = Alpha2Code("VU") - //Alpha2VE represents 'VE' country alpha-2 code - Alpha2VE = Alpha2Code("VE") - //Alpha2VN represents 'VN' country alpha-2 code - Alpha2VN = Alpha2Code("VN") - //Alpha2VG represents 'VG' country alpha-2 code - Alpha2VG = Alpha2Code("VG") - //Alpha2VI represents 'VI' country alpha-2 code - Alpha2VI = Alpha2Code("VI") - //Alpha2WF represents 'WF' country alpha-2 code - Alpha2WF = Alpha2Code("WF") - //Alpha2EH represents 'EH' country alpha-2 code - Alpha2EH = Alpha2Code("EH") - //Alpha2YE represents 'YE' country alpha-2 code - Alpha2YE = Alpha2Code("YE") - //Alpha2ZM represents 'ZM' country alpha-2 code - Alpha2ZM = Alpha2Code("ZM") - //Alpha2ZW represents 'ZW' country alpha-2 code - Alpha2ZW = Alpha2Code("ZW") - //Alpha2AX represents 'AX' country alpha-2 code - Alpha2AX = Alpha2Code("AX") -) diff --git a/country/alpha3.go b/country/alpha3.go new file mode 100644 index 0000000..975e9d6 --- /dev/null +++ b/country/alpha3.go @@ -0,0 +1,57 @@ +package country + +import ( + "database/sql/driver" + "encoding/json" +) + +// Alpha3Code represents alpha-3 code +type Alpha3Code string + +// UnmarshalJSON unmarshall implementation for alpha3code +func (code *Alpha3Code) UnmarshalJSON(data []byte) error { + var str string + if err := json.Unmarshal(data, &str); err != nil { + return err + } + + enumValue := Alpha3Code(str) + if _, err := ByAlpha3CodeErr(enumValue); err != nil { + return err + } + + *code = enumValue + return nil +} + +// Value implementation of driver.Valuer +func (code Alpha3Code) Value() (value driver.Value, err error) { + if code == "" { + return "", nil + } + + var country Country + + if country, err = ByAlpha3CodeErr(code); err != nil { + return nil, err + } + + return country.Alpha3Code().String(), nil +} + +// Validate implementation of ozzo-validation Validate interface +func (code Alpha3Code) Validate() (err error) { + _, err = ByAlpha3CodeErr(code) + + return +} + +// IsSet indicates if Name is set +func (code Alpha3Code) IsSet() bool { + return len(string(code)) > 0 +} + +// String implementation of Stringer interface +func (code Alpha3Code) String() string { + return string(code) +} diff --git a/country/alpha3/alpha_3_gen.go b/country/alpha3/alpha_3_gen.go new file mode 100644 index 0000000..64e5bf4 --- /dev/null +++ b/country/alpha3/alpha_3_gen.go @@ -0,0 +1,504 @@ +package alpha3 + +import "github.com/mikekonan/go-types/v2/country" + +const ( + // AFG represents 'AFG' country alpha-3 code + AFG = country.Alpha3Code("AFG") + // ALB represents 'ALB' country alpha-3 code + ALB = country.Alpha3Code("ALB") + // DZA represents 'DZA' country alpha-3 code + DZA = country.Alpha3Code("DZA") + // ASM represents 'ASM' country alpha-3 code + ASM = country.Alpha3Code("ASM") + // AND represents 'AND' country alpha-3 code + AND = country.Alpha3Code("AND") + // AGO represents 'AGO' country alpha-3 code + AGO = country.Alpha3Code("AGO") + // AIA represents 'AIA' country alpha-3 code + AIA = country.Alpha3Code("AIA") + // ATA represents 'ATA' country alpha-3 code + ATA = country.Alpha3Code("ATA") + // ATG represents 'ATG' country alpha-3 code + ATG = country.Alpha3Code("ATG") + // ARG represents 'ARG' country alpha-3 code + ARG = country.Alpha3Code("ARG") + // ARM represents 'ARM' country alpha-3 code + ARM = country.Alpha3Code("ARM") + // ABW represents 'ABW' country alpha-3 code + ABW = country.Alpha3Code("ABW") + // AUS represents 'AUS' country alpha-3 code + AUS = country.Alpha3Code("AUS") + // AUT represents 'AUT' country alpha-3 code + AUT = country.Alpha3Code("AUT") + // AZE represents 'AZE' country alpha-3 code + AZE = country.Alpha3Code("AZE") + // BHS represents 'BHS' country alpha-3 code + BHS = country.Alpha3Code("BHS") + // BHR represents 'BHR' country alpha-3 code + BHR = country.Alpha3Code("BHR") + // BGD represents 'BGD' country alpha-3 code + BGD = country.Alpha3Code("BGD") + // BRB represents 'BRB' country alpha-3 code + BRB = country.Alpha3Code("BRB") + // BLR represents 'BLR' country alpha-3 code + BLR = country.Alpha3Code("BLR") + // BEL represents 'BEL' country alpha-3 code + BEL = country.Alpha3Code("BEL") + // BLZ represents 'BLZ' country alpha-3 code + BLZ = country.Alpha3Code("BLZ") + // BEN represents 'BEN' country alpha-3 code + BEN = country.Alpha3Code("BEN") + // BMU represents 'BMU' country alpha-3 code + BMU = country.Alpha3Code("BMU") + // BTN represents 'BTN' country alpha-3 code + BTN = country.Alpha3Code("BTN") + // BOL represents 'BOL' country alpha-3 code + BOL = country.Alpha3Code("BOL") + // BES represents 'BES' country alpha-3 code + BES = country.Alpha3Code("BES") + // BIH represents 'BIH' country alpha-3 code + BIH = country.Alpha3Code("BIH") + // BWA represents 'BWA' country alpha-3 code + BWA = country.Alpha3Code("BWA") + // BVT represents 'BVT' country alpha-3 code + BVT = country.Alpha3Code("BVT") + // BRA represents 'BRA' country alpha-3 code + BRA = country.Alpha3Code("BRA") + // IOT represents 'IOT' country alpha-3 code + IOT = country.Alpha3Code("IOT") + // BRN represents 'BRN' country alpha-3 code + BRN = country.Alpha3Code("BRN") + // BGR represents 'BGR' country alpha-3 code + BGR = country.Alpha3Code("BGR") + // BFA represents 'BFA' country alpha-3 code + BFA = country.Alpha3Code("BFA") + // BDI represents 'BDI' country alpha-3 code + BDI = country.Alpha3Code("BDI") + // CPV represents 'CPV' country alpha-3 code + CPV = country.Alpha3Code("CPV") + // KHM represents 'KHM' country alpha-3 code + KHM = country.Alpha3Code("KHM") + // CMR represents 'CMR' country alpha-3 code + CMR = country.Alpha3Code("CMR") + // CAN represents 'CAN' country alpha-3 code + CAN = country.Alpha3Code("CAN") + // CYM represents 'CYM' country alpha-3 code + CYM = country.Alpha3Code("CYM") + // CAF represents 'CAF' country alpha-3 code + CAF = country.Alpha3Code("CAF") + // TCD represents 'TCD' country alpha-3 code + TCD = country.Alpha3Code("TCD") + // CHL represents 'CHL' country alpha-3 code + CHL = country.Alpha3Code("CHL") + // CHN represents 'CHN' country alpha-3 code + CHN = country.Alpha3Code("CHN") + // CXR represents 'CXR' country alpha-3 code + CXR = country.Alpha3Code("CXR") + // CCK represents 'CCK' country alpha-3 code + CCK = country.Alpha3Code("CCK") + // COL represents 'COL' country alpha-3 code + COL = country.Alpha3Code("COL") + // COM represents 'COM' country alpha-3 code + COM = country.Alpha3Code("COM") + // COD represents 'COD' country alpha-3 code + COD = country.Alpha3Code("COD") + // COG represents 'COG' country alpha-3 code + COG = country.Alpha3Code("COG") + // COK represents 'COK' country alpha-3 code + COK = country.Alpha3Code("COK") + // CRI represents 'CRI' country alpha-3 code + CRI = country.Alpha3Code("CRI") + // HRV represents 'HRV' country alpha-3 code + HRV = country.Alpha3Code("HRV") + // CUB represents 'CUB' country alpha-3 code + CUB = country.Alpha3Code("CUB") + // CUW represents 'CUW' country alpha-3 code + CUW = country.Alpha3Code("CUW") + // CYP represents 'CYP' country alpha-3 code + CYP = country.Alpha3Code("CYP") + // CZE represents 'CZE' country alpha-3 code + CZE = country.Alpha3Code("CZE") + // CIV represents 'CIV' country alpha-3 code + CIV = country.Alpha3Code("CIV") + // DNK represents 'DNK' country alpha-3 code + DNK = country.Alpha3Code("DNK") + // DJI represents 'DJI' country alpha-3 code + DJI = country.Alpha3Code("DJI") + // DMA represents 'DMA' country alpha-3 code + DMA = country.Alpha3Code("DMA") + // DOM represents 'DOM' country alpha-3 code + DOM = country.Alpha3Code("DOM") + // ECU represents 'ECU' country alpha-3 code + ECU = country.Alpha3Code("ECU") + // EGY represents 'EGY' country alpha-3 code + EGY = country.Alpha3Code("EGY") + // SLV represents 'SLV' country alpha-3 code + SLV = country.Alpha3Code("SLV") + // GNQ represents 'GNQ' country alpha-3 code + GNQ = country.Alpha3Code("GNQ") + // ERI represents 'ERI' country alpha-3 code + ERI = country.Alpha3Code("ERI") + // EST represents 'EST' country alpha-3 code + EST = country.Alpha3Code("EST") + // SWZ represents 'SWZ' country alpha-3 code + SWZ = country.Alpha3Code("SWZ") + // ETH represents 'ETH' country alpha-3 code + ETH = country.Alpha3Code("ETH") + // FLK represents 'FLK' country alpha-3 code + FLK = country.Alpha3Code("FLK") + // FRO represents 'FRO' country alpha-3 code + FRO = country.Alpha3Code("FRO") + // FJI represents 'FJI' country alpha-3 code + FJI = country.Alpha3Code("FJI") + // FIN represents 'FIN' country alpha-3 code + FIN = country.Alpha3Code("FIN") + // FRA represents 'FRA' country alpha-3 code + FRA = country.Alpha3Code("FRA") + // GUF represents 'GUF' country alpha-3 code + GUF = country.Alpha3Code("GUF") + // PYF represents 'PYF' country alpha-3 code + PYF = country.Alpha3Code("PYF") + // ATF represents 'ATF' country alpha-3 code + ATF = country.Alpha3Code("ATF") + // GAB represents 'GAB' country alpha-3 code + GAB = country.Alpha3Code("GAB") + // GMB represents 'GMB' country alpha-3 code + GMB = country.Alpha3Code("GMB") + // GEO represents 'GEO' country alpha-3 code + GEO = country.Alpha3Code("GEO") + // DEU represents 'DEU' country alpha-3 code + DEU = country.Alpha3Code("DEU") + // GHA represents 'GHA' country alpha-3 code + GHA = country.Alpha3Code("GHA") + // GIB represents 'GIB' country alpha-3 code + GIB = country.Alpha3Code("GIB") + // GRC represents 'GRC' country alpha-3 code + GRC = country.Alpha3Code("GRC") + // GRL represents 'GRL' country alpha-3 code + GRL = country.Alpha3Code("GRL") + // GRD represents 'GRD' country alpha-3 code + GRD = country.Alpha3Code("GRD") + // GLP represents 'GLP' country alpha-3 code + GLP = country.Alpha3Code("GLP") + // GUM represents 'GUM' country alpha-3 code + GUM = country.Alpha3Code("GUM") + // GTM represents 'GTM' country alpha-3 code + GTM = country.Alpha3Code("GTM") + // GGY represents 'GGY' country alpha-3 code + GGY = country.Alpha3Code("GGY") + // GIN represents 'GIN' country alpha-3 code + GIN = country.Alpha3Code("GIN") + // GNB represents 'GNB' country alpha-3 code + GNB = country.Alpha3Code("GNB") + // GUY represents 'GUY' country alpha-3 code + GUY = country.Alpha3Code("GUY") + // HTI represents 'HTI' country alpha-3 code + HTI = country.Alpha3Code("HTI") + // HMD represents 'HMD' country alpha-3 code + HMD = country.Alpha3Code("HMD") + // VAT represents 'VAT' country alpha-3 code + VAT = country.Alpha3Code("VAT") + // HND represents 'HND' country alpha-3 code + HND = country.Alpha3Code("HND") + // HKG represents 'HKG' country alpha-3 code + HKG = country.Alpha3Code("HKG") + // HUN represents 'HUN' country alpha-3 code + HUN = country.Alpha3Code("HUN") + // ISL represents 'ISL' country alpha-3 code + ISL = country.Alpha3Code("ISL") + // IND represents 'IND' country alpha-3 code + IND = country.Alpha3Code("IND") + // IDN represents 'IDN' country alpha-3 code + IDN = country.Alpha3Code("IDN") + // IRN represents 'IRN' country alpha-3 code + IRN = country.Alpha3Code("IRN") + // IRQ represents 'IRQ' country alpha-3 code + IRQ = country.Alpha3Code("IRQ") + // IRL represents 'IRL' country alpha-3 code + IRL = country.Alpha3Code("IRL") + // IMN represents 'IMN' country alpha-3 code + IMN = country.Alpha3Code("IMN") + // ISR represents 'ISR' country alpha-3 code + ISR = country.Alpha3Code("ISR") + // ITA represents 'ITA' country alpha-3 code + ITA = country.Alpha3Code("ITA") + // JAM represents 'JAM' country alpha-3 code + JAM = country.Alpha3Code("JAM") + // JPN represents 'JPN' country alpha-3 code + JPN = country.Alpha3Code("JPN") + // JEY represents 'JEY' country alpha-3 code + JEY = country.Alpha3Code("JEY") + // JOR represents 'JOR' country alpha-3 code + JOR = country.Alpha3Code("JOR") + // KAZ represents 'KAZ' country alpha-3 code + KAZ = country.Alpha3Code("KAZ") + // KEN represents 'KEN' country alpha-3 code + KEN = country.Alpha3Code("KEN") + // KIR represents 'KIR' country alpha-3 code + KIR = country.Alpha3Code("KIR") + // PRK represents 'PRK' country alpha-3 code + PRK = country.Alpha3Code("PRK") + // KOR represents 'KOR' country alpha-3 code + KOR = country.Alpha3Code("KOR") + // KWT represents 'KWT' country alpha-3 code + KWT = country.Alpha3Code("KWT") + // KGZ represents 'KGZ' country alpha-3 code + KGZ = country.Alpha3Code("KGZ") + // LAO represents 'LAO' country alpha-3 code + LAO = country.Alpha3Code("LAO") + // LVA represents 'LVA' country alpha-3 code + LVA = country.Alpha3Code("LVA") + // LBN represents 'LBN' country alpha-3 code + LBN = country.Alpha3Code("LBN") + // LSO represents 'LSO' country alpha-3 code + LSO = country.Alpha3Code("LSO") + // LBR represents 'LBR' country alpha-3 code + LBR = country.Alpha3Code("LBR") + // LBY represents 'LBY' country alpha-3 code + LBY = country.Alpha3Code("LBY") + // LIE represents 'LIE' country alpha-3 code + LIE = country.Alpha3Code("LIE") + // LTU represents 'LTU' country alpha-3 code + LTU = country.Alpha3Code("LTU") + // LUX represents 'LUX' country alpha-3 code + LUX = country.Alpha3Code("LUX") + // MAC represents 'MAC' country alpha-3 code + MAC = country.Alpha3Code("MAC") + // MDG represents 'MDG' country alpha-3 code + MDG = country.Alpha3Code("MDG") + // MWI represents 'MWI' country alpha-3 code + MWI = country.Alpha3Code("MWI") + // MYS represents 'MYS' country alpha-3 code + MYS = country.Alpha3Code("MYS") + // MDV represents 'MDV' country alpha-3 code + MDV = country.Alpha3Code("MDV") + // MLI represents 'MLI' country alpha-3 code + MLI = country.Alpha3Code("MLI") + // MLT represents 'MLT' country alpha-3 code + MLT = country.Alpha3Code("MLT") + // MHL represents 'MHL' country alpha-3 code + MHL = country.Alpha3Code("MHL") + // MTQ represents 'MTQ' country alpha-3 code + MTQ = country.Alpha3Code("MTQ") + // MRT represents 'MRT' country alpha-3 code + MRT = country.Alpha3Code("MRT") + // MUS represents 'MUS' country alpha-3 code + MUS = country.Alpha3Code("MUS") + // MYT represents 'MYT' country alpha-3 code + MYT = country.Alpha3Code("MYT") + // MEX represents 'MEX' country alpha-3 code + MEX = country.Alpha3Code("MEX") + // FSM represents 'FSM' country alpha-3 code + FSM = country.Alpha3Code("FSM") + // MDA represents 'MDA' country alpha-3 code + MDA = country.Alpha3Code("MDA") + // MCO represents 'MCO' country alpha-3 code + MCO = country.Alpha3Code("MCO") + // MNG represents 'MNG' country alpha-3 code + MNG = country.Alpha3Code("MNG") + // MNE represents 'MNE' country alpha-3 code + MNE = country.Alpha3Code("MNE") + // MSR represents 'MSR' country alpha-3 code + MSR = country.Alpha3Code("MSR") + // MAR represents 'MAR' country alpha-3 code + MAR = country.Alpha3Code("MAR") + // MOZ represents 'MOZ' country alpha-3 code + MOZ = country.Alpha3Code("MOZ") + // MMR represents 'MMR' country alpha-3 code + MMR = country.Alpha3Code("MMR") + // NAM represents 'NAM' country alpha-3 code + NAM = country.Alpha3Code("NAM") + // NRU represents 'NRU' country alpha-3 code + NRU = country.Alpha3Code("NRU") + // NPL represents 'NPL' country alpha-3 code + NPL = country.Alpha3Code("NPL") + // NLD represents 'NLD' country alpha-3 code + NLD = country.Alpha3Code("NLD") + // NCL represents 'NCL' country alpha-3 code + NCL = country.Alpha3Code("NCL") + // NZL represents 'NZL' country alpha-3 code + NZL = country.Alpha3Code("NZL") + // NIC represents 'NIC' country alpha-3 code + NIC = country.Alpha3Code("NIC") + // NER represents 'NER' country alpha-3 code + NER = country.Alpha3Code("NER") + // NGA represents 'NGA' country alpha-3 code + NGA = country.Alpha3Code("NGA") + // NIU represents 'NIU' country alpha-3 code + NIU = country.Alpha3Code("NIU") + // NFK represents 'NFK' country alpha-3 code + NFK = country.Alpha3Code("NFK") + // MKD represents 'MKD' country alpha-3 code + MKD = country.Alpha3Code("MKD") + // MNP represents 'MNP' country alpha-3 code + MNP = country.Alpha3Code("MNP") + // NOR represents 'NOR' country alpha-3 code + NOR = country.Alpha3Code("NOR") + // OMN represents 'OMN' country alpha-3 code + OMN = country.Alpha3Code("OMN") + // PAK represents 'PAK' country alpha-3 code + PAK = country.Alpha3Code("PAK") + // PLW represents 'PLW' country alpha-3 code + PLW = country.Alpha3Code("PLW") + // PSE represents 'PSE' country alpha-3 code + PSE = country.Alpha3Code("PSE") + // PAN represents 'PAN' country alpha-3 code + PAN = country.Alpha3Code("PAN") + // PNG represents 'PNG' country alpha-3 code + PNG = country.Alpha3Code("PNG") + // PRY represents 'PRY' country alpha-3 code + PRY = country.Alpha3Code("PRY") + // PER represents 'PER' country alpha-3 code + PER = country.Alpha3Code("PER") + // PHL represents 'PHL' country alpha-3 code + PHL = country.Alpha3Code("PHL") + // PCN represents 'PCN' country alpha-3 code + PCN = country.Alpha3Code("PCN") + // POL represents 'POL' country alpha-3 code + POL = country.Alpha3Code("POL") + // PRT represents 'PRT' country alpha-3 code + PRT = country.Alpha3Code("PRT") + // PRI represents 'PRI' country alpha-3 code + PRI = country.Alpha3Code("PRI") + // QAT represents 'QAT' country alpha-3 code + QAT = country.Alpha3Code("QAT") + // ROU represents 'ROU' country alpha-3 code + ROU = country.Alpha3Code("ROU") + // RUS represents 'RUS' country alpha-3 code + RUS = country.Alpha3Code("RUS") + // RWA represents 'RWA' country alpha-3 code + RWA = country.Alpha3Code("RWA") + // REU represents 'REU' country alpha-3 code + REU = country.Alpha3Code("REU") + // BLM represents 'BLM' country alpha-3 code + BLM = country.Alpha3Code("BLM") + // SHN represents 'SHN' country alpha-3 code + SHN = country.Alpha3Code("SHN") + // KNA represents 'KNA' country alpha-3 code + KNA = country.Alpha3Code("KNA") + // LCA represents 'LCA' country alpha-3 code + LCA = country.Alpha3Code("LCA") + // MAF represents 'MAF' country alpha-3 code + MAF = country.Alpha3Code("MAF") + // SPM represents 'SPM' country alpha-3 code + SPM = country.Alpha3Code("SPM") + // VCT represents 'VCT' country alpha-3 code + VCT = country.Alpha3Code("VCT") + // WSM represents 'WSM' country alpha-3 code + WSM = country.Alpha3Code("WSM") + // SMR represents 'SMR' country alpha-3 code + SMR = country.Alpha3Code("SMR") + // STP represents 'STP' country alpha-3 code + STP = country.Alpha3Code("STP") + // SAU represents 'SAU' country alpha-3 code + SAU = country.Alpha3Code("SAU") + // SEN represents 'SEN' country alpha-3 code + SEN = country.Alpha3Code("SEN") + // SRB represents 'SRB' country alpha-3 code + SRB = country.Alpha3Code("SRB") + // SYC represents 'SYC' country alpha-3 code + SYC = country.Alpha3Code("SYC") + // SLE represents 'SLE' country alpha-3 code + SLE = country.Alpha3Code("SLE") + // SGP represents 'SGP' country alpha-3 code + SGP = country.Alpha3Code("SGP") + // SXM represents 'SXM' country alpha-3 code + SXM = country.Alpha3Code("SXM") + // SVK represents 'SVK' country alpha-3 code + SVK = country.Alpha3Code("SVK") + // SVN represents 'SVN' country alpha-3 code + SVN = country.Alpha3Code("SVN") + // SLB represents 'SLB' country alpha-3 code + SLB = country.Alpha3Code("SLB") + // SOM represents 'SOM' country alpha-3 code + SOM = country.Alpha3Code("SOM") + // ZAF represents 'ZAF' country alpha-3 code + ZAF = country.Alpha3Code("ZAF") + // SGS represents 'SGS' country alpha-3 code + SGS = country.Alpha3Code("SGS") + // SSD represents 'SSD' country alpha-3 code + SSD = country.Alpha3Code("SSD") + // ESP represents 'ESP' country alpha-3 code + ESP = country.Alpha3Code("ESP") + // LKA represents 'LKA' country alpha-3 code + LKA = country.Alpha3Code("LKA") + // SDN represents 'SDN' country alpha-3 code + SDN = country.Alpha3Code("SDN") + // SUR represents 'SUR' country alpha-3 code + SUR = country.Alpha3Code("SUR") + // SJM represents 'SJM' country alpha-3 code + SJM = country.Alpha3Code("SJM") + // SWE represents 'SWE' country alpha-3 code + SWE = country.Alpha3Code("SWE") + // CHE represents 'CHE' country alpha-3 code + CHE = country.Alpha3Code("CHE") + // SYR represents 'SYR' country alpha-3 code + SYR = country.Alpha3Code("SYR") + // TWN represents 'TWN' country alpha-3 code + TWN = country.Alpha3Code("TWN") + // TJK represents 'TJK' country alpha-3 code + TJK = country.Alpha3Code("TJK") + // TZA represents 'TZA' country alpha-3 code + TZA = country.Alpha3Code("TZA") + // THA represents 'THA' country alpha-3 code + THA = country.Alpha3Code("THA") + // TLS represents 'TLS' country alpha-3 code + TLS = country.Alpha3Code("TLS") + // TGO represents 'TGO' country alpha-3 code + TGO = country.Alpha3Code("TGO") + // TKL represents 'TKL' country alpha-3 code + TKL = country.Alpha3Code("TKL") + // TON represents 'TON' country alpha-3 code + TON = country.Alpha3Code("TON") + // TTO represents 'TTO' country alpha-3 code + TTO = country.Alpha3Code("TTO") + // TUN represents 'TUN' country alpha-3 code + TUN = country.Alpha3Code("TUN") + // TKM represents 'TKM' country alpha-3 code + TKM = country.Alpha3Code("TKM") + // TCA represents 'TCA' country alpha-3 code + TCA = country.Alpha3Code("TCA") + // TUV represents 'TUV' country alpha-3 code + TUV = country.Alpha3Code("TUV") + // TUR represents 'TUR' country alpha-3 code + TUR = country.Alpha3Code("TUR") + // UGA represents 'UGA' country alpha-3 code + UGA = country.Alpha3Code("UGA") + // UKR represents 'UKR' country alpha-3 code + UKR = country.Alpha3Code("UKR") + // ARE represents 'ARE' country alpha-3 code + ARE = country.Alpha3Code("ARE") + // GBR represents 'GBR' country alpha-3 code + GBR = country.Alpha3Code("GBR") + // UMI represents 'UMI' country alpha-3 code + UMI = country.Alpha3Code("UMI") + // USA represents 'USA' country alpha-3 code + USA = country.Alpha3Code("USA") + // URY represents 'URY' country alpha-3 code + URY = country.Alpha3Code("URY") + // UZB represents 'UZB' country alpha-3 code + UZB = country.Alpha3Code("UZB") + // VUT represents 'VUT' country alpha-3 code + VUT = country.Alpha3Code("VUT") + // VEN represents 'VEN' country alpha-3 code + VEN = country.Alpha3Code("VEN") + // VNM represents 'VNM' country alpha-3 code + VNM = country.Alpha3Code("VNM") + // VGB represents 'VGB' country alpha-3 code + VGB = country.Alpha3Code("VGB") + // VIR represents 'VIR' country alpha-3 code + VIR = country.Alpha3Code("VIR") + // WLF represents 'WLF' country alpha-3 code + WLF = country.Alpha3Code("WLF") + // ESH represents 'ESH' country alpha-3 code + ESH = country.Alpha3Code("ESH") + // YEM represents 'YEM' country alpha-3 code + YEM = country.Alpha3Code("YEM") + // ZMB represents 'ZMB' country alpha-3 code + ZMB = country.Alpha3Code("ZMB") + // ZWE represents 'ZWE' country alpha-3 code + ZWE = country.Alpha3Code("ZWE") + // ALA represents 'ALA' country alpha-3 code + ALA = country.Alpha3Code("ALA") +) diff --git a/country/alpha3_gen.go b/country/alpha3_gen.go deleted file mode 100644 index ec98496..0000000 --- a/country/alpha3_gen.go +++ /dev/null @@ -1,502 +0,0 @@ -package country - -const ( - //Alpha3AFG represents 'AFG' country alpha-3 code - Alpha3AFG = Alpha3Code("AFG") - //Alpha3ALB represents 'ALB' country alpha-3 code - Alpha3ALB = Alpha3Code("ALB") - //Alpha3DZA represents 'DZA' country alpha-3 code - Alpha3DZA = Alpha3Code("DZA") - //Alpha3ASM represents 'ASM' country alpha-3 code - Alpha3ASM = Alpha3Code("ASM") - //Alpha3AND represents 'AND' country alpha-3 code - Alpha3AND = Alpha3Code("AND") - //Alpha3AGO represents 'AGO' country alpha-3 code - Alpha3AGO = Alpha3Code("AGO") - //Alpha3AIA represents 'AIA' country alpha-3 code - Alpha3AIA = Alpha3Code("AIA") - //Alpha3ATA represents 'ATA' country alpha-3 code - Alpha3ATA = Alpha3Code("ATA") - //Alpha3ATG represents 'ATG' country alpha-3 code - Alpha3ATG = Alpha3Code("ATG") - //Alpha3ARG represents 'ARG' country alpha-3 code - Alpha3ARG = Alpha3Code("ARG") - //Alpha3ARM represents 'ARM' country alpha-3 code - Alpha3ARM = Alpha3Code("ARM") - //Alpha3ABW represents 'ABW' country alpha-3 code - Alpha3ABW = Alpha3Code("ABW") - //Alpha3AUS represents 'AUS' country alpha-3 code - Alpha3AUS = Alpha3Code("AUS") - //Alpha3AUT represents 'AUT' country alpha-3 code - Alpha3AUT = Alpha3Code("AUT") - //Alpha3AZE represents 'AZE' country alpha-3 code - Alpha3AZE = Alpha3Code("AZE") - //Alpha3BHS represents 'BHS' country alpha-3 code - Alpha3BHS = Alpha3Code("BHS") - //Alpha3BHR represents 'BHR' country alpha-3 code - Alpha3BHR = Alpha3Code("BHR") - //Alpha3BGD represents 'BGD' country alpha-3 code - Alpha3BGD = Alpha3Code("BGD") - //Alpha3BRB represents 'BRB' country alpha-3 code - Alpha3BRB = Alpha3Code("BRB") - //Alpha3BLR represents 'BLR' country alpha-3 code - Alpha3BLR = Alpha3Code("BLR") - //Alpha3BEL represents 'BEL' country alpha-3 code - Alpha3BEL = Alpha3Code("BEL") - //Alpha3BLZ represents 'BLZ' country alpha-3 code - Alpha3BLZ = Alpha3Code("BLZ") - //Alpha3BEN represents 'BEN' country alpha-3 code - Alpha3BEN = Alpha3Code("BEN") - //Alpha3BMU represents 'BMU' country alpha-3 code - Alpha3BMU = Alpha3Code("BMU") - //Alpha3BTN represents 'BTN' country alpha-3 code - Alpha3BTN = Alpha3Code("BTN") - //Alpha3BOL represents 'BOL' country alpha-3 code - Alpha3BOL = Alpha3Code("BOL") - //Alpha3BES represents 'BES' country alpha-3 code - Alpha3BES = Alpha3Code("BES") - //Alpha3BIH represents 'BIH' country alpha-3 code - Alpha3BIH = Alpha3Code("BIH") - //Alpha3BWA represents 'BWA' country alpha-3 code - Alpha3BWA = Alpha3Code("BWA") - //Alpha3BVT represents 'BVT' country alpha-3 code - Alpha3BVT = Alpha3Code("BVT") - //Alpha3BRA represents 'BRA' country alpha-3 code - Alpha3BRA = Alpha3Code("BRA") - //Alpha3IOT represents 'IOT' country alpha-3 code - Alpha3IOT = Alpha3Code("IOT") - //Alpha3BRN represents 'BRN' country alpha-3 code - Alpha3BRN = Alpha3Code("BRN") - //Alpha3BGR represents 'BGR' country alpha-3 code - Alpha3BGR = Alpha3Code("BGR") - //Alpha3BFA represents 'BFA' country alpha-3 code - Alpha3BFA = Alpha3Code("BFA") - //Alpha3BDI represents 'BDI' country alpha-3 code - Alpha3BDI = Alpha3Code("BDI") - //Alpha3CPV represents 'CPV' country alpha-3 code - Alpha3CPV = Alpha3Code("CPV") - //Alpha3KHM represents 'KHM' country alpha-3 code - Alpha3KHM = Alpha3Code("KHM") - //Alpha3CMR represents 'CMR' country alpha-3 code - Alpha3CMR = Alpha3Code("CMR") - //Alpha3CAN represents 'CAN' country alpha-3 code - Alpha3CAN = Alpha3Code("CAN") - //Alpha3CYM represents 'CYM' country alpha-3 code - Alpha3CYM = Alpha3Code("CYM") - //Alpha3CAF represents 'CAF' country alpha-3 code - Alpha3CAF = Alpha3Code("CAF") - //Alpha3TCD represents 'TCD' country alpha-3 code - Alpha3TCD = Alpha3Code("TCD") - //Alpha3CHL represents 'CHL' country alpha-3 code - Alpha3CHL = Alpha3Code("CHL") - //Alpha3CHN represents 'CHN' country alpha-3 code - Alpha3CHN = Alpha3Code("CHN") - //Alpha3CXR represents 'CXR' country alpha-3 code - Alpha3CXR = Alpha3Code("CXR") - //Alpha3CCK represents 'CCK' country alpha-3 code - Alpha3CCK = Alpha3Code("CCK") - //Alpha3COL represents 'COL' country alpha-3 code - Alpha3COL = Alpha3Code("COL") - //Alpha3COM represents 'COM' country alpha-3 code - Alpha3COM = Alpha3Code("COM") - //Alpha3COD represents 'COD' country alpha-3 code - Alpha3COD = Alpha3Code("COD") - //Alpha3COG represents 'COG' country alpha-3 code - Alpha3COG = Alpha3Code("COG") - //Alpha3COK represents 'COK' country alpha-3 code - Alpha3COK = Alpha3Code("COK") - //Alpha3CRI represents 'CRI' country alpha-3 code - Alpha3CRI = Alpha3Code("CRI") - //Alpha3HRV represents 'HRV' country alpha-3 code - Alpha3HRV = Alpha3Code("HRV") - //Alpha3CUB represents 'CUB' country alpha-3 code - Alpha3CUB = Alpha3Code("CUB") - //Alpha3CUW represents 'CUW' country alpha-3 code - Alpha3CUW = Alpha3Code("CUW") - //Alpha3CYP represents 'CYP' country alpha-3 code - Alpha3CYP = Alpha3Code("CYP") - //Alpha3CZE represents 'CZE' country alpha-3 code - Alpha3CZE = Alpha3Code("CZE") - //Alpha3CIV represents 'CIV' country alpha-3 code - Alpha3CIV = Alpha3Code("CIV") - //Alpha3DNK represents 'DNK' country alpha-3 code - Alpha3DNK = Alpha3Code("DNK") - //Alpha3DJI represents 'DJI' country alpha-3 code - Alpha3DJI = Alpha3Code("DJI") - //Alpha3DMA represents 'DMA' country alpha-3 code - Alpha3DMA = Alpha3Code("DMA") - //Alpha3DOM represents 'DOM' country alpha-3 code - Alpha3DOM = Alpha3Code("DOM") - //Alpha3ECU represents 'ECU' country alpha-3 code - Alpha3ECU = Alpha3Code("ECU") - //Alpha3EGY represents 'EGY' country alpha-3 code - Alpha3EGY = Alpha3Code("EGY") - //Alpha3SLV represents 'SLV' country alpha-3 code - Alpha3SLV = Alpha3Code("SLV") - //Alpha3GNQ represents 'GNQ' country alpha-3 code - Alpha3GNQ = Alpha3Code("GNQ") - //Alpha3ERI represents 'ERI' country alpha-3 code - Alpha3ERI = Alpha3Code("ERI") - //Alpha3EST represents 'EST' country alpha-3 code - Alpha3EST = Alpha3Code("EST") - //Alpha3SWZ represents 'SWZ' country alpha-3 code - Alpha3SWZ = Alpha3Code("SWZ") - //Alpha3ETH represents 'ETH' country alpha-3 code - Alpha3ETH = Alpha3Code("ETH") - //Alpha3FLK represents 'FLK' country alpha-3 code - Alpha3FLK = Alpha3Code("FLK") - //Alpha3FRO represents 'FRO' country alpha-3 code - Alpha3FRO = Alpha3Code("FRO") - //Alpha3FJI represents 'FJI' country alpha-3 code - Alpha3FJI = Alpha3Code("FJI") - //Alpha3FIN represents 'FIN' country alpha-3 code - Alpha3FIN = Alpha3Code("FIN") - //Alpha3FRA represents 'FRA' country alpha-3 code - Alpha3FRA = Alpha3Code("FRA") - //Alpha3GUF represents 'GUF' country alpha-3 code - Alpha3GUF = Alpha3Code("GUF") - //Alpha3PYF represents 'PYF' country alpha-3 code - Alpha3PYF = Alpha3Code("PYF") - //Alpha3ATF represents 'ATF' country alpha-3 code - Alpha3ATF = Alpha3Code("ATF") - //Alpha3GAB represents 'GAB' country alpha-3 code - Alpha3GAB = Alpha3Code("GAB") - //Alpha3GMB represents 'GMB' country alpha-3 code - Alpha3GMB = Alpha3Code("GMB") - //Alpha3GEO represents 'GEO' country alpha-3 code - Alpha3GEO = Alpha3Code("GEO") - //Alpha3DEU represents 'DEU' country alpha-3 code - Alpha3DEU = Alpha3Code("DEU") - //Alpha3GHA represents 'GHA' country alpha-3 code - Alpha3GHA = Alpha3Code("GHA") - //Alpha3GIB represents 'GIB' country alpha-3 code - Alpha3GIB = Alpha3Code("GIB") - //Alpha3GRC represents 'GRC' country alpha-3 code - Alpha3GRC = Alpha3Code("GRC") - //Alpha3GRL represents 'GRL' country alpha-3 code - Alpha3GRL = Alpha3Code("GRL") - //Alpha3GRD represents 'GRD' country alpha-3 code - Alpha3GRD = Alpha3Code("GRD") - //Alpha3GLP represents 'GLP' country alpha-3 code - Alpha3GLP = Alpha3Code("GLP") - //Alpha3GUM represents 'GUM' country alpha-3 code - Alpha3GUM = Alpha3Code("GUM") - //Alpha3GTM represents 'GTM' country alpha-3 code - Alpha3GTM = Alpha3Code("GTM") - //Alpha3GGY represents 'GGY' country alpha-3 code - Alpha3GGY = Alpha3Code("GGY") - //Alpha3GIN represents 'GIN' country alpha-3 code - Alpha3GIN = Alpha3Code("GIN") - //Alpha3GNB represents 'GNB' country alpha-3 code - Alpha3GNB = Alpha3Code("GNB") - //Alpha3GUY represents 'GUY' country alpha-3 code - Alpha3GUY = Alpha3Code("GUY") - //Alpha3HTI represents 'HTI' country alpha-3 code - Alpha3HTI = Alpha3Code("HTI") - //Alpha3HMD represents 'HMD' country alpha-3 code - Alpha3HMD = Alpha3Code("HMD") - //Alpha3VAT represents 'VAT' country alpha-3 code - Alpha3VAT = Alpha3Code("VAT") - //Alpha3HND represents 'HND' country alpha-3 code - Alpha3HND = Alpha3Code("HND") - //Alpha3HKG represents 'HKG' country alpha-3 code - Alpha3HKG = Alpha3Code("HKG") - //Alpha3HUN represents 'HUN' country alpha-3 code - Alpha3HUN = Alpha3Code("HUN") - //Alpha3ISL represents 'ISL' country alpha-3 code - Alpha3ISL = Alpha3Code("ISL") - //Alpha3IND represents 'IND' country alpha-3 code - Alpha3IND = Alpha3Code("IND") - //Alpha3IDN represents 'IDN' country alpha-3 code - Alpha3IDN = Alpha3Code("IDN") - //Alpha3IRN represents 'IRN' country alpha-3 code - Alpha3IRN = Alpha3Code("IRN") - //Alpha3IRQ represents 'IRQ' country alpha-3 code - Alpha3IRQ = Alpha3Code("IRQ") - //Alpha3IRL represents 'IRL' country alpha-3 code - Alpha3IRL = Alpha3Code("IRL") - //Alpha3IMN represents 'IMN' country alpha-3 code - Alpha3IMN = Alpha3Code("IMN") - //Alpha3ISR represents 'ISR' country alpha-3 code - Alpha3ISR = Alpha3Code("ISR") - //Alpha3ITA represents 'ITA' country alpha-3 code - Alpha3ITA = Alpha3Code("ITA") - //Alpha3JAM represents 'JAM' country alpha-3 code - Alpha3JAM = Alpha3Code("JAM") - //Alpha3JPN represents 'JPN' country alpha-3 code - Alpha3JPN = Alpha3Code("JPN") - //Alpha3JEY represents 'JEY' country alpha-3 code - Alpha3JEY = Alpha3Code("JEY") - //Alpha3JOR represents 'JOR' country alpha-3 code - Alpha3JOR = Alpha3Code("JOR") - //Alpha3KAZ represents 'KAZ' country alpha-3 code - Alpha3KAZ = Alpha3Code("KAZ") - //Alpha3KEN represents 'KEN' country alpha-3 code - Alpha3KEN = Alpha3Code("KEN") - //Alpha3KIR represents 'KIR' country alpha-3 code - Alpha3KIR = Alpha3Code("KIR") - //Alpha3PRK represents 'PRK' country alpha-3 code - Alpha3PRK = Alpha3Code("PRK") - //Alpha3KOR represents 'KOR' country alpha-3 code - Alpha3KOR = Alpha3Code("KOR") - //Alpha3KWT represents 'KWT' country alpha-3 code - Alpha3KWT = Alpha3Code("KWT") - //Alpha3KGZ represents 'KGZ' country alpha-3 code - Alpha3KGZ = Alpha3Code("KGZ") - //Alpha3LAO represents 'LAO' country alpha-3 code - Alpha3LAO = Alpha3Code("LAO") - //Alpha3LVA represents 'LVA' country alpha-3 code - Alpha3LVA = Alpha3Code("LVA") - //Alpha3LBN represents 'LBN' country alpha-3 code - Alpha3LBN = Alpha3Code("LBN") - //Alpha3LSO represents 'LSO' country alpha-3 code - Alpha3LSO = Alpha3Code("LSO") - //Alpha3LBR represents 'LBR' country alpha-3 code - Alpha3LBR = Alpha3Code("LBR") - //Alpha3LBY represents 'LBY' country alpha-3 code - Alpha3LBY = Alpha3Code("LBY") - //Alpha3LIE represents 'LIE' country alpha-3 code - Alpha3LIE = Alpha3Code("LIE") - //Alpha3LTU represents 'LTU' country alpha-3 code - Alpha3LTU = Alpha3Code("LTU") - //Alpha3LUX represents 'LUX' country alpha-3 code - Alpha3LUX = Alpha3Code("LUX") - //Alpha3MAC represents 'MAC' country alpha-3 code - Alpha3MAC = Alpha3Code("MAC") - //Alpha3MDG represents 'MDG' country alpha-3 code - Alpha3MDG = Alpha3Code("MDG") - //Alpha3MWI represents 'MWI' country alpha-3 code - Alpha3MWI = Alpha3Code("MWI") - //Alpha3MYS represents 'MYS' country alpha-3 code - Alpha3MYS = Alpha3Code("MYS") - //Alpha3MDV represents 'MDV' country alpha-3 code - Alpha3MDV = Alpha3Code("MDV") - //Alpha3MLI represents 'MLI' country alpha-3 code - Alpha3MLI = Alpha3Code("MLI") - //Alpha3MLT represents 'MLT' country alpha-3 code - Alpha3MLT = Alpha3Code("MLT") - //Alpha3MHL represents 'MHL' country alpha-3 code - Alpha3MHL = Alpha3Code("MHL") - //Alpha3MTQ represents 'MTQ' country alpha-3 code - Alpha3MTQ = Alpha3Code("MTQ") - //Alpha3MRT represents 'MRT' country alpha-3 code - Alpha3MRT = Alpha3Code("MRT") - //Alpha3MUS represents 'MUS' country alpha-3 code - Alpha3MUS = Alpha3Code("MUS") - //Alpha3MYT represents 'MYT' country alpha-3 code - Alpha3MYT = Alpha3Code("MYT") - //Alpha3MEX represents 'MEX' country alpha-3 code - Alpha3MEX = Alpha3Code("MEX") - //Alpha3FSM represents 'FSM' country alpha-3 code - Alpha3FSM = Alpha3Code("FSM") - //Alpha3MDA represents 'MDA' country alpha-3 code - Alpha3MDA = Alpha3Code("MDA") - //Alpha3MCO represents 'MCO' country alpha-3 code - Alpha3MCO = Alpha3Code("MCO") - //Alpha3MNG represents 'MNG' country alpha-3 code - Alpha3MNG = Alpha3Code("MNG") - //Alpha3MNE represents 'MNE' country alpha-3 code - Alpha3MNE = Alpha3Code("MNE") - //Alpha3MSR represents 'MSR' country alpha-3 code - Alpha3MSR = Alpha3Code("MSR") - //Alpha3MAR represents 'MAR' country alpha-3 code - Alpha3MAR = Alpha3Code("MAR") - //Alpha3MOZ represents 'MOZ' country alpha-3 code - Alpha3MOZ = Alpha3Code("MOZ") - //Alpha3MMR represents 'MMR' country alpha-3 code - Alpha3MMR = Alpha3Code("MMR") - //Alpha3NAM represents 'NAM' country alpha-3 code - Alpha3NAM = Alpha3Code("NAM") - //Alpha3NRU represents 'NRU' country alpha-3 code - Alpha3NRU = Alpha3Code("NRU") - //Alpha3NPL represents 'NPL' country alpha-3 code - Alpha3NPL = Alpha3Code("NPL") - //Alpha3NLD represents 'NLD' country alpha-3 code - Alpha3NLD = Alpha3Code("NLD") - //Alpha3NCL represents 'NCL' country alpha-3 code - Alpha3NCL = Alpha3Code("NCL") - //Alpha3NZL represents 'NZL' country alpha-3 code - Alpha3NZL = Alpha3Code("NZL") - //Alpha3NIC represents 'NIC' country alpha-3 code - Alpha3NIC = Alpha3Code("NIC") - //Alpha3NER represents 'NER' country alpha-3 code - Alpha3NER = Alpha3Code("NER") - //Alpha3NGA represents 'NGA' country alpha-3 code - Alpha3NGA = Alpha3Code("NGA") - //Alpha3NIU represents 'NIU' country alpha-3 code - Alpha3NIU = Alpha3Code("NIU") - //Alpha3NFK represents 'NFK' country alpha-3 code - Alpha3NFK = Alpha3Code("NFK") - //Alpha3MKD represents 'MKD' country alpha-3 code - Alpha3MKD = Alpha3Code("MKD") - //Alpha3MNP represents 'MNP' country alpha-3 code - Alpha3MNP = Alpha3Code("MNP") - //Alpha3NOR represents 'NOR' country alpha-3 code - Alpha3NOR = Alpha3Code("NOR") - //Alpha3OMN represents 'OMN' country alpha-3 code - Alpha3OMN = Alpha3Code("OMN") - //Alpha3PAK represents 'PAK' country alpha-3 code - Alpha3PAK = Alpha3Code("PAK") - //Alpha3PLW represents 'PLW' country alpha-3 code - Alpha3PLW = Alpha3Code("PLW") - //Alpha3PSE represents 'PSE' country alpha-3 code - Alpha3PSE = Alpha3Code("PSE") - //Alpha3PAN represents 'PAN' country alpha-3 code - Alpha3PAN = Alpha3Code("PAN") - //Alpha3PNG represents 'PNG' country alpha-3 code - Alpha3PNG = Alpha3Code("PNG") - //Alpha3PRY represents 'PRY' country alpha-3 code - Alpha3PRY = Alpha3Code("PRY") - //Alpha3PER represents 'PER' country alpha-3 code - Alpha3PER = Alpha3Code("PER") - //Alpha3PHL represents 'PHL' country alpha-3 code - Alpha3PHL = Alpha3Code("PHL") - //Alpha3PCN represents 'PCN' country alpha-3 code - Alpha3PCN = Alpha3Code("PCN") - //Alpha3POL represents 'POL' country alpha-3 code - Alpha3POL = Alpha3Code("POL") - //Alpha3PRT represents 'PRT' country alpha-3 code - Alpha3PRT = Alpha3Code("PRT") - //Alpha3PRI represents 'PRI' country alpha-3 code - Alpha3PRI = Alpha3Code("PRI") - //Alpha3QAT represents 'QAT' country alpha-3 code - Alpha3QAT = Alpha3Code("QAT") - //Alpha3ROU represents 'ROU' country alpha-3 code - Alpha3ROU = Alpha3Code("ROU") - //Alpha3RUS represents 'RUS' country alpha-3 code - Alpha3RUS = Alpha3Code("RUS") - //Alpha3RWA represents 'RWA' country alpha-3 code - Alpha3RWA = Alpha3Code("RWA") - //Alpha3REU represents 'REU' country alpha-3 code - Alpha3REU = Alpha3Code("REU") - //Alpha3BLM represents 'BLM' country alpha-3 code - Alpha3BLM = Alpha3Code("BLM") - //Alpha3SHN represents 'SHN' country alpha-3 code - Alpha3SHN = Alpha3Code("SHN") - //Alpha3KNA represents 'KNA' country alpha-3 code - Alpha3KNA = Alpha3Code("KNA") - //Alpha3LCA represents 'LCA' country alpha-3 code - Alpha3LCA = Alpha3Code("LCA") - //Alpha3MAF represents 'MAF' country alpha-3 code - Alpha3MAF = Alpha3Code("MAF") - //Alpha3SPM represents 'SPM' country alpha-3 code - Alpha3SPM = Alpha3Code("SPM") - //Alpha3VCT represents 'VCT' country alpha-3 code - Alpha3VCT = Alpha3Code("VCT") - //Alpha3WSM represents 'WSM' country alpha-3 code - Alpha3WSM = Alpha3Code("WSM") - //Alpha3SMR represents 'SMR' country alpha-3 code - Alpha3SMR = Alpha3Code("SMR") - //Alpha3STP represents 'STP' country alpha-3 code - Alpha3STP = Alpha3Code("STP") - //Alpha3SAU represents 'SAU' country alpha-3 code - Alpha3SAU = Alpha3Code("SAU") - //Alpha3SEN represents 'SEN' country alpha-3 code - Alpha3SEN = Alpha3Code("SEN") - //Alpha3SRB represents 'SRB' country alpha-3 code - Alpha3SRB = Alpha3Code("SRB") - //Alpha3SYC represents 'SYC' country alpha-3 code - Alpha3SYC = Alpha3Code("SYC") - //Alpha3SLE represents 'SLE' country alpha-3 code - Alpha3SLE = Alpha3Code("SLE") - //Alpha3SGP represents 'SGP' country alpha-3 code - Alpha3SGP = Alpha3Code("SGP") - //Alpha3SXM represents 'SXM' country alpha-3 code - Alpha3SXM = Alpha3Code("SXM") - //Alpha3SVK represents 'SVK' country alpha-3 code - Alpha3SVK = Alpha3Code("SVK") - //Alpha3SVN represents 'SVN' country alpha-3 code - Alpha3SVN = Alpha3Code("SVN") - //Alpha3SLB represents 'SLB' country alpha-3 code - Alpha3SLB = Alpha3Code("SLB") - //Alpha3SOM represents 'SOM' country alpha-3 code - Alpha3SOM = Alpha3Code("SOM") - //Alpha3ZAF represents 'ZAF' country alpha-3 code - Alpha3ZAF = Alpha3Code("ZAF") - //Alpha3SGS represents 'SGS' country alpha-3 code - Alpha3SGS = Alpha3Code("SGS") - //Alpha3SSD represents 'SSD' country alpha-3 code - Alpha3SSD = Alpha3Code("SSD") - //Alpha3ESP represents 'ESP' country alpha-3 code - Alpha3ESP = Alpha3Code("ESP") - //Alpha3LKA represents 'LKA' country alpha-3 code - Alpha3LKA = Alpha3Code("LKA") - //Alpha3SDN represents 'SDN' country alpha-3 code - Alpha3SDN = Alpha3Code("SDN") - //Alpha3SUR represents 'SUR' country alpha-3 code - Alpha3SUR = Alpha3Code("SUR") - //Alpha3SJM represents 'SJM' country alpha-3 code - Alpha3SJM = Alpha3Code("SJM") - //Alpha3SWE represents 'SWE' country alpha-3 code - Alpha3SWE = Alpha3Code("SWE") - //Alpha3CHE represents 'CHE' country alpha-3 code - Alpha3CHE = Alpha3Code("CHE") - //Alpha3SYR represents 'SYR' country alpha-3 code - Alpha3SYR = Alpha3Code("SYR") - //Alpha3TWN represents 'TWN' country alpha-3 code - Alpha3TWN = Alpha3Code("TWN") - //Alpha3TJK represents 'TJK' country alpha-3 code - Alpha3TJK = Alpha3Code("TJK") - //Alpha3TZA represents 'TZA' country alpha-3 code - Alpha3TZA = Alpha3Code("TZA") - //Alpha3THA represents 'THA' country alpha-3 code - Alpha3THA = Alpha3Code("THA") - //Alpha3TLS represents 'TLS' country alpha-3 code - Alpha3TLS = Alpha3Code("TLS") - //Alpha3TGO represents 'TGO' country alpha-3 code - Alpha3TGO = Alpha3Code("TGO") - //Alpha3TKL represents 'TKL' country alpha-3 code - Alpha3TKL = Alpha3Code("TKL") - //Alpha3TON represents 'TON' country alpha-3 code - Alpha3TON = Alpha3Code("TON") - //Alpha3TTO represents 'TTO' country alpha-3 code - Alpha3TTO = Alpha3Code("TTO") - //Alpha3TUN represents 'TUN' country alpha-3 code - Alpha3TUN = Alpha3Code("TUN") - //Alpha3TUR represents 'TUR' country alpha-3 code - Alpha3TUR = Alpha3Code("TUR") - //Alpha3TKM represents 'TKM' country alpha-3 code - Alpha3TKM = Alpha3Code("TKM") - //Alpha3TCA represents 'TCA' country alpha-3 code - Alpha3TCA = Alpha3Code("TCA") - //Alpha3TUV represents 'TUV' country alpha-3 code - Alpha3TUV = Alpha3Code("TUV") - //Alpha3UGA represents 'UGA' country alpha-3 code - Alpha3UGA = Alpha3Code("UGA") - //Alpha3UKR represents 'UKR' country alpha-3 code - Alpha3UKR = Alpha3Code("UKR") - //Alpha3ARE represents 'ARE' country alpha-3 code - Alpha3ARE = Alpha3Code("ARE") - //Alpha3GBR represents 'GBR' country alpha-3 code - Alpha3GBR = Alpha3Code("GBR") - //Alpha3UMI represents 'UMI' country alpha-3 code - Alpha3UMI = Alpha3Code("UMI") - //Alpha3USA represents 'USA' country alpha-3 code - Alpha3USA = Alpha3Code("USA") - //Alpha3URY represents 'URY' country alpha-3 code - Alpha3URY = Alpha3Code("URY") - //Alpha3UZB represents 'UZB' country alpha-3 code - Alpha3UZB = Alpha3Code("UZB") - //Alpha3VUT represents 'VUT' country alpha-3 code - Alpha3VUT = Alpha3Code("VUT") - //Alpha3VEN represents 'VEN' country alpha-3 code - Alpha3VEN = Alpha3Code("VEN") - //Alpha3VNM represents 'VNM' country alpha-3 code - Alpha3VNM = Alpha3Code("VNM") - //Alpha3VGB represents 'VGB' country alpha-3 code - Alpha3VGB = Alpha3Code("VGB") - //Alpha3VIR represents 'VIR' country alpha-3 code - Alpha3VIR = Alpha3Code("VIR") - //Alpha3WLF represents 'WLF' country alpha-3 code - Alpha3WLF = Alpha3Code("WLF") - //Alpha3ESH represents 'ESH' country alpha-3 code - Alpha3ESH = Alpha3Code("ESH") - //Alpha3YEM represents 'YEM' country alpha-3 code - Alpha3YEM = Alpha3Code("YEM") - //Alpha3ZMB represents 'ZMB' country alpha-3 code - Alpha3ZMB = Alpha3Code("ZMB") - //Alpha3ZWE represents 'ZWE' country alpha-3 code - Alpha3ZWE = Alpha3Code("ZWE") - //Alpha3ALA represents 'ALA' country alpha-3 code - Alpha3ALA = Alpha3Code("ALA") -) diff --git a/country/country.go b/country/country.go index 390f10f..f51c6ab 100644 --- a/country/country.go +++ b/country/country.go @@ -12,209 +12,48 @@ Author Mikalai Konan(mikalai.konan@icloud.com). package country import ( - "database/sql/driver" - "encoding/json" "fmt" "strings" ) -//Name represents country name -type Name string - -//UnmarshalJSON unmarshall implementation for name -func (name *Name) UnmarshalJSON(data []byte) error { - var str string - if err := json.Unmarshal(data, &str); err != nil { - return err - } - - enumValue := Name(str) - if _, err := ByNameErr(enumValue); err != nil { - return err - } - - *name = enumValue - return nil -} - -//Value implementation of driver.Valuer -func (name Name) Value() (value driver.Value, err error) { - if name == "" { - return "", nil - } - - if _, err = ByNameErr(name); err != nil { - return nil, err - } - - return name.String(), nil -} - -//Validate implementation of ozzo-validation Validate interface -func (name Name) Validate() (err error) { - _, err = ByNameErr(name) - - return -} - -//IsSet indicates if Name is set -func (name Name) IsSet() bool { - return len(string(name)) > 0 -} - -//String implementation of Stringer interface -func (name Name) String() string { - return string(name) -} - -//Alpha2Code represents alpha-2 code -type Alpha2Code string - -//UnmarshalJSON unmarshall implementation for alpha2code -func (code *Alpha2Code) UnmarshalJSON(data []byte) error { - var str string - if err := json.Unmarshal(data, &str); err != nil { - return err - } - - enumValue := Alpha2Code(str) - if _, err := ByAlpha2CodeErr(enumValue); err != nil { - return err - } - - *code = enumValue - return nil -} - -//Value implementation of driver.Valuer -func (code Alpha2Code) Value() (value driver.Value, err error) { - if code == "" { - return "", nil - } - - var country Country - - if country, err = ByAlpha2CodeErr(code); err != nil { - return nil, err - } - - return country.Alpha2Code().String(), nil -} - -//Validate implementation of ozzo-validation Validate interface -func (code Alpha2Code) Validate() (err error) { - _, err = ByAlpha2CodeErr(code) - - return -} - -//IsSet indicates if Name is set -func (code Alpha2Code) IsSet() bool { - return len(string(code)) > 0 -} - -//String implementation of Stringer interface -func (code Alpha2Code) String() string { - return string(code) -} - -func (code Alpha2Code) toUpper() Alpha2Code { - return Alpha2Code(strings.ToUpper(code.String())) -} - -//Alpha3Code represents alpha-3 code -type Alpha3Code string - -//UnmarshalJSON unmarshall implementation for alpha3code -func (code *Alpha3Code) UnmarshalJSON(data []byte) error { - var str string - if err := json.Unmarshal(data, &str); err != nil { - return err - } - - enumValue := Alpha3Code(str) - if _, err := ByAlpha3CodeErr(enumValue); err != nil { - return err - } - - *code = enumValue - return nil -} - -//Value implementation of driver.Valuer -func (code Alpha3Code) Value() (value driver.Value, err error) { - if code == "" { - return "", nil - } - - var country Country - - if country, err = ByAlpha3CodeErr(code); err != nil { - return nil, err - } - - return country.Alpha3Code().String(), nil -} - -//Validate implementation of ozzo-validation Validate interface -func (code Alpha3Code) Validate() (err error) { - _, err = ByAlpha3CodeErr(code) - - return -} - -//IsSet indicates if Name is set -func (code Alpha3Code) IsSet() bool { - return len(string(code)) > 0 -} - -//String implementation of Stringer interface -func (code Alpha3Code) String() string { - return string(code) -} - -func (code Alpha3Code) toUpper() Alpha3Code { - return Alpha3Code(strings.ToUpper(code.String())) -} - -//Country represents country entity according to ISO-3166. +// Country represents country entity according to ISO-3166. type Country struct { name Name alpha2 Alpha2Code alpha3 Alpha3Code } -//Name returns country name +// Name returns country name func (country Country) Name() Name { return country.name } -//Alpha2Code returns alpha-2 code +// Alpha2Code returns alpha-2 code func (country Country) Alpha2Code() Alpha2Code { return country.alpha2 } -//Alpha3Code returns alpha-2 code +// Alpha3Code returns alpha-2 code func (country Country) Alpha3Code() Alpha3Code { return country.alpha3 } -//NameStr returns country name string +// NameStr returns country name string func (country Country) NameStr() string { return country.name.String() } -//Alpha2CodeStr returns country alpha-2 code string +// Alpha2CodeStr returns country alpha-2 code string func (country Country) Alpha2CodeStr() string { return country.alpha2.String() } -//Alpha3CodeStr returns country alpha-2 code string +// Alpha3CodeStr returns country alpha-2 code string func (country Country) Alpha3CodeStr() string { return country.alpha3.String() } -//ByAlpha3Code lookup for country by alpha-3 code +// ByAlpha3Code lookup for country by alpha-3 code func ByAlpha3Code(code Alpha3Code) (result Country, ok bool) { - result, ok = countryByAlpha3[code.toUpper()] + result, ok = CountryByAlpha3[strings.ToUpper(code.String())] return } -//ByAlpha3CodeStr lookup for country by alpha-3 code string +// ByAlpha3CodeStr lookup for country by alpha-3 code string func ByAlpha3CodeStr(code string) (result Country, ok bool) { return ByAlpha3Code(Alpha3Code(code)) } -//ByAlpha3CodeErr lookup for country by alpha-3 code with error return type +// ByAlpha3CodeErr lookup for country by alpha-3 code with error return type func ByAlpha3CodeErr(code Alpha3Code) (result Country, err error) { var ok bool result, ok = ByAlpha3Code(code) @@ -225,23 +64,23 @@ func ByAlpha3CodeErr(code Alpha3Code) (result Country, err error) { return } -//ByAlpha3CodeStrErr lookup for country by alpha-3 code string with error return type +// ByAlpha3CodeStrErr lookup for country by alpha-3 code string with error return type func ByAlpha3CodeStrErr(code string) (result Country, err error) { return ByAlpha3CodeErr(Alpha3Code(code)) } -//ByAlpha2Code lookup for country by alpha-2 code +// ByAlpha2Code lookup for country by alpha-2 code func ByAlpha2Code(code Alpha2Code) (result Country, ok bool) { - result, ok = countryByAlpha2[code.toUpper()] + result, ok = CountryByAlpha2[strings.ToUpper(code.String())] return } -//ByAlpha2CodeStr lookup for country by alpha-2 code string +// ByAlpha2CodeStr lookup for country by alpha-2 code string func ByAlpha2CodeStr(code string) (result Country, ok bool) { return ByAlpha2Code(Alpha2Code(code)) } -//ByAlpha2CodeErr lookup for country by alpha-2 code with error return type +// ByAlpha2CodeErr lookup for country by alpha-2 code with error return type func ByAlpha2CodeErr(code Alpha2Code) (result Country, err error) { var ok bool result, ok = ByAlpha2Code(code) @@ -252,23 +91,23 @@ func ByAlpha2CodeErr(code Alpha2Code) (result Country, err error) { return } -//ByAlpha2CodeStrErr lookup for country by alpha-2 code string with error return type +// ByAlpha2CodeStrErr lookup for country by alpha-2 code string with error return type func ByAlpha2CodeStrErr(code string) (result Country, err error) { return ByAlpha2CodeErr(Alpha2Code(code)) } -//ByName lookup for country by name +// ByName lookup for country by name func ByName(country Name) (result Country, ok bool) { - result, ok = countryByName[country] + result, ok = CountryByName[country.String()] return } -//ByNameStr lookup for country by name string +// ByNameStr lookup for country by name string func ByNameStr(country string) (result Country, ok bool) { return ByName(Name(country)) } -//ByNameErr lookup for country by name with error return type +// ByNameErr lookup for country by name with error return type func ByNameErr(country Name) (result Country, err error) { var ok bool result, ok = ByName(country) @@ -279,7 +118,7 @@ func ByNameErr(country Name) (result Country, err error) { return } -//ByNameStrErr lookup for country by name string with error return type +// ByNameStrErr lookup for country by name string with error return type func ByNameStrErr(country string) (result Country, err error) { return ByNameErr(Name(country)) } diff --git a/country/country_mapping_gen.go b/country/country_mapping_gen.go index d03ce2f..3846421 100644 --- a/country/country_mapping_gen.go +++ b/country/country_mapping_gen.go @@ -1,757 +1,757 @@ package country -var countryByName = map[Name]Country{ - NameAfghanistan: Afghanistan, - NameAlbania: Albania, - NameAlgeria: Algeria, - NameAmericanSamoa: AmericanSamoa, - NameAndorra: Andorra, - NameAngola: Angola, - NameAnguilla: Anguilla, - NameAntarctica: Antarctica, - NameAntiguaAndBarbuda: AntiguaAndBarbuda, - NameArgentina: Argentina, - NameArmenia: Armenia, - NameAruba: Aruba, - NameAustralia: Australia, - NameAustria: Austria, - NameAzerbaijan: Azerbaijan, - NameBahamas: Bahamas, - NameBahrain: Bahrain, - NameBangladesh: Bangladesh, - NameBarbados: Barbados, - NameBelarus: Belarus, - NameBelgium: Belgium, - NameBelize: Belize, - NameBenin: Benin, - NameBermuda: Bermuda, - NameBhutan: Bhutan, - NameBolivia: Bolivia, - NameBonaireSintEustatiusAndSaba: BonaireSintEustatiusAndSaba, - NameBosniaAndHerzegovina: BosniaAndHerzegovina, - NameBotswana: Botswana, - NameBouvetIsland: BouvetIsland, - NameBrazil: Brazil, - NameBritishIndianOceanTerritory: BritishIndianOceanTerritory, - NameBruneiDarussalam: BruneiDarussalam, - NameBulgaria: Bulgaria, - NameBurkinaFaso: BurkinaFaso, - NameBurundi: Burundi, - NameCaboVerde: CaboVerde, - NameCambodia: Cambodia, - NameCameroon: Cameroon, - NameCanada: Canada, - NameCaymanIslands: CaymanIslands, - NameCentralAfricanRepublic: CentralAfricanRepublic, - NameChad: Chad, - NameChile: Chile, - NameChina: China, - NameChristmasIsland: ChristmasIsland, - NameCocos: Cocos, - NameColombia: Colombia, - NameComoros: Comoros, - NameDemocraticRepublicOfTheCongo: DemocraticRepublicOfTheCongo, - NameCongo: Congo, - NameCookIslands: CookIslands, - NameCostaRica: CostaRica, - NameCroatia: Croatia, - NameCuba: Cuba, - NameCuracao: Curacao, - NameCyprus: Cyprus, - NameCzechia: Czechia, - NameCoteDIvoire: CoteDIvoire, - NameDenmark: Denmark, - NameDjibouti: Djibouti, - NameDominica: Dominica, - NameDominicanRepublic: DominicanRepublic, - NameEcuador: Ecuador, - NameEgypt: Egypt, - NameElSalvador: ElSalvador, - NameEquatorialGuinea: EquatorialGuinea, - NameEritrea: Eritrea, - NameEstonia: Estonia, - NameEswatini: Eswatini, - NameEthiopia: Ethiopia, - NameFalklandIslands: FalklandIslands, - NameFaroeIslands: FaroeIslands, - NameFiji: Fiji, - NameFinland: Finland, - NameFrance: France, - NameFrenchGuiana: FrenchGuiana, - NameFrenchPolynesia: FrenchPolynesia, - NameFrenchSouthernTerritories: FrenchSouthernTerritories, - NameGabon: Gabon, - NameGambia: Gambia, - NameGeorgia: Georgia, - NameGermany: Germany, - NameGhana: Ghana, - NameGibraltar: Gibraltar, - NameGreece: Greece, - NameGreenland: Greenland, - NameGrenada: Grenada, - NameGuadeloupe: Guadeloupe, - NameGuam: Guam, - NameGuatemala: Guatemala, - NameGuernsey: Guernsey, - NameGuinea: Guinea, - NameGuineaBissau: GuineaBissau, - NameGuyana: Guyana, - NameHaiti: Haiti, - NameHeardIslandAndMcDonaldIslands: HeardIslandAndMcDonaldIslands, - NameHolySee: HolySee, - NameHonduras: Honduras, - NameHongKong: HongKong, - NameHungary: Hungary, - NameIceland: Iceland, - NameIndia: India, - NameIndonesia: Indonesia, - NameIran: Iran, - NameIraq: Iraq, - NameIreland: Ireland, - NameIsleOfMan: IsleOfMan, - NameIsrael: Israel, - NameItaly: Italy, - NameJamaica: Jamaica, - NameJapan: Japan, - NameJersey: Jersey, - NameJordan: Jordan, - NameKazakhstan: Kazakhstan, - NameKenya: Kenya, - NameKiribati: Kiribati, - NameNorthKorea: NorthKorea, - NameSouthKorea: SouthKorea, - NameKuwait: Kuwait, - NameKyrgyzstan: Kyrgyzstan, - NameLaoPeoplesDemocraticRepublic: LaoPeoplesDemocraticRepublic, - NameLatvia: Latvia, - NameLebanon: Lebanon, - NameLesotho: Lesotho, - NameLiberia: Liberia, - NameLibya: Libya, - NameLiechtenstein: Liechtenstein, - NameLithuania: Lithuania, - NameLuxembourg: Luxembourg, - NameMacao: Macao, - NameMadagascar: Madagascar, - NameMalawi: Malawi, - NameMalaysia: Malaysia, - NameMaldives: Maldives, - NameMali: Mali, - NameMalta: Malta, - NameMarshallIslands: MarshallIslands, - NameMartinique: Martinique, - NameMauritania: Mauritania, - NameMauritius: Mauritius, - NameMayotte: Mayotte, - NameMexico: Mexico, - NameMicronesia: Micronesia, - NameMoldova: Moldova, - NameMonaco: Monaco, - NameMongolia: Mongolia, - NameMontenegro: Montenegro, - NameMontserrat: Montserrat, - NameMorocco: Morocco, - NameMozambique: Mozambique, - NameMyanmar: Myanmar, - NameNamibia: Namibia, - NameNauru: Nauru, - NameNepal: Nepal, - NameNetherlands: Netherlands, - NameNewCaledonia: NewCaledonia, - NameNewZealand: NewZealand, - NameNicaragua: Nicaragua, - NameNiger: Niger, - NameNigeria: Nigeria, - NameNiue: Niue, - NameNorfolkIsland: NorfolkIsland, - NameNorthMacedonia: NorthMacedonia, - NameNorthernMarianaIslands: NorthernMarianaIslands, - NameNorway: Norway, - NameOman: Oman, - NamePakistan: Pakistan, - NamePalau: Palau, - NamePalestine: Palestine, - NamePanama: Panama, - NamePapuaNewGuinea: PapuaNewGuinea, - NameParaguay: Paraguay, - NamePeru: Peru, - NamePhilippines: Philippines, - NamePitcairn: Pitcairn, - NamePoland: Poland, - NamePortugal: Portugal, - NamePuertoRico: PuertoRico, - NameQatar: Qatar, - NameRomania: Romania, - NameRussianFederation: RussianFederation, - NameRwanda: Rwanda, - NameReunion: Reunion, - NameSaintBarthelemy: SaintBarthelemy, - NameSaintHelenaAscensionAndTristanDaCunha: SaintHelenaAscensionAndTristanDaCunha, - NameSaintKittsAndNevis: SaintKittsAndNevis, - NameSaintLucia: SaintLucia, - NameSaintMartin: SaintMartin, - NameSaintPierreAndMiquelon: SaintPierreAndMiquelon, - NameSaintVincentAndTheGrenadines: SaintVincentAndTheGrenadines, - NameSamoa: Samoa, - NameSanMarino: SanMarino, - NameSaoTomeAndPrincipe: SaoTomeAndPrincipe, - NameSaudiArabia: SaudiArabia, - NameSenegal: Senegal, - NameSerbia: Serbia, - NameSeychelles: Seychelles, - NameSierraLeone: SierraLeone, - NameSingapore: Singapore, - NameSintMaarten: SintMaarten, - NameSlovakia: Slovakia, - NameSlovenia: Slovenia, - NameSolomonIslands: SolomonIslands, - NameSomalia: Somalia, - NameSouthAfrica: SouthAfrica, - NameSouthGeorgiaAndTheSouthSandwichIslands: SouthGeorgiaAndTheSouthSandwichIslands, - NameSouthSudan: SouthSudan, - NameSpain: Spain, - NameSriLanka: SriLanka, - NameSudan: Sudan, - NameSuriname: Suriname, - NameSvalbardAndJanMayen: SvalbardAndJanMayen, - NameSweden: Sweden, - NameSwitzerland: Switzerland, - NameSyrianArabRepublic: SyrianArabRepublic, - NameTaiwan: Taiwan, - NameTajikistan: Tajikistan, - NameTanzaniaTheUnitedRepublicOf: TanzaniaTheUnitedRepublicOf, - NameThailand: Thailand, - NameTimorLeste: TimorLeste, - NameTogo: Togo, - NameTokelau: Tokelau, - NameTonga: Tonga, - NameTrinidadAndTobago: TrinidadAndTobago, - NameTunisia: Tunisia, - NameTurkey: Turkey, - NameTurkmenistan: Turkmenistan, - NameTurksAndCaicosIslands: TurksAndCaicosIslands, - NameTuvalu: Tuvalu, - NameUganda: Uganda, - NameUkraine: Ukraine, - NameUnitedArabEmirates: UnitedArabEmirates, - NameUnitedKingdomOfGreatBritainAndNorthernIreland: UnitedKingdomOfGreatBritainAndNorthernIreland, - NameUnitedStatesMinorOutlyingIslands: UnitedStatesMinorOutlyingIslands, - NameUnitedStatesOfAmerica: UnitedStatesOfAmerica, - NameUruguay: Uruguay, - NameUzbekistan: Uzbekistan, - NameVanuatu: Vanuatu, - NameVenezuela: Venezuela, - NameVietNam: VietNam, - NameBritishVirginIslands: BritishVirginIslands, - NameUSVirginIslands: USVirginIslands, - NameWallisAndFutuna: WallisAndFutuna, - NameWesternSahara: WesternSahara, - NameYemen: Yemen, - NameZambia: Zambia, - NameZimbabwe: Zimbabwe, - NameAlandIslands: AlandIslands, +var CountryByName = map[string]Country{ + "Afghanistan": Afghanistan, + "Albania": Albania, + "Algeria": Algeria, + "American Samoa": AmericanSamoa, + "Andorra": Andorra, + "Angola": Angola, + "Anguilla": Anguilla, + "Antarctica": Antarctica, + "Antigua and Barbuda": AntiguaAndBarbuda, + "Argentina": Argentina, + "Armenia": Armenia, + "Aruba": Aruba, + "Australia": Australia, + "Austria": Austria, + "Azerbaijan": Azerbaijan, + "Bahamas (the)": Bahamas, + "Bahrain": Bahrain, + "Bangladesh": Bangladesh, + "Barbados": Barbados, + "Belarus": Belarus, + "Belgium": Belgium, + "Belize": Belize, + "Benin": Benin, + "Bermuda": Bermuda, + "Bhutan": Bhutan, + "Bolivia (Plurinational State of)": Bolivia, + "Bonaire, Sint Eustatius and Saba": BonaireSintEustatiusAndSaba, + "Bosnia and Herzegovina": BosniaAndHerzegovina, + "Botswana": Botswana, + "Bouvet Island": BouvetIsland, + "Brazil": Brazil, + "British Indian Ocean Territory (the)": BritishIndianOceanTerritory, + "Brunei Darussalam": BruneiDarussalam, + "Bulgaria": Bulgaria, + "Burkina Faso": BurkinaFaso, + "Burundi": Burundi, + "Cabo Verde": CaboVerde, + "Cambodia": Cambodia, + "Cameroon": Cameroon, + "Canada": Canada, + "Cayman Islands (the)": CaymanIslands, + "Central African Republic (the)": CentralAfricanRepublic, + "Chad": Chad, + "Chile": Chile, + "China": China, + "Christmas Island": ChristmasIsland, + "Cocos (Keeling) Islands (the)": Cocos, + "Colombia": Colombia, + "Comoros (the)": Comoros, + "Congo (the Democratic Republic of the)": DemocraticRepublicOfTheCongo, + "Congo (the)": Congo, + "Cook Islands (the)": CookIslands, + "Costa Rica": CostaRica, + "Croatia": Croatia, + "Cuba": Cuba, + "Curaçao": Curacao, + "Cyprus": Cyprus, + "Czechia": Czechia, + "Côte d'Ivoire": CoteDIvoire, + "Denmark": Denmark, + "Djibouti": Djibouti, + "Dominica": Dominica, + "Dominican Republic (the)": DominicanRepublic, + "Ecuador": Ecuador, + "Egypt": Egypt, + "El Salvador": ElSalvador, + "Equatorial Guinea": EquatorialGuinea, + "Eritrea": Eritrea, + "Estonia": Estonia, + "Eswatini": Eswatini, + "Ethiopia": Ethiopia, + "Falkland Islands (the) [Malvinas]": FalklandIslands, + "Faroe Islands (the)": FaroeIslands, + "Fiji": Fiji, + "Finland": Finland, + "France": France, + "French Guiana": FrenchGuiana, + "French Polynesia": FrenchPolynesia, + "French Southern Territories (the)": FrenchSouthernTerritories, + "Gabon": Gabon, + "Gambia (the)": Gambia, + "Georgia": Georgia, + "Germany": Germany, + "Ghana": Ghana, + "Gibraltar": Gibraltar, + "Greece": Greece, + "Greenland": Greenland, + "Grenada": Grenada, + "Guadeloupe": Guadeloupe, + "Guam": Guam, + "Guatemala": Guatemala, + "Guernsey": Guernsey, + "Guinea": Guinea, + "Guinea-Bissau": GuineaBissau, + "Guyana": Guyana, + "Haiti": Haiti, + "Heard Island and McDonald Islands": HeardIslandAndMcDonaldIslands, + "Holy See (the)": HolySee, + "Honduras": Honduras, + "Hong Kong": HongKong, + "Hungary": Hungary, + "Iceland": Iceland, + "India": India, + "Indonesia": Indonesia, + "Iran (Islamic Republic of)": Iran, + "Iraq": Iraq, + "Ireland": Ireland, + "Isle of Man": IsleOfMan, + "Israel": Israel, + "Italy": Italy, + "Jamaica": Jamaica, + "Japan": Japan, + "Jersey": Jersey, + "Jordan": Jordan, + "Kazakhstan": Kazakhstan, + "Kenya": Kenya, + "Kiribati": Kiribati, + "Korea (the Democratic People's Republic of)": NorthKorea, + "Korea (the Republic of)": SouthKorea, + "Kuwait": Kuwait, + "Kyrgyzstan": Kyrgyzstan, + "Lao People's Democratic Republic (the)": LaoPeoplesDemocraticRepublic, + "Latvia": Latvia, + "Lebanon": Lebanon, + "Lesotho": Lesotho, + "Liberia": Liberia, + "Libya": Libya, + "Liechtenstein": Liechtenstein, + "Lithuania": Lithuania, + "Luxembourg": Luxembourg, + "Macao": Macao, + "Madagascar": Madagascar, + "Malawi": Malawi, + "Malaysia": Malaysia, + "Maldives": Maldives, + "Mali": Mali, + "Malta": Malta, + "Marshall Islands (the)": MarshallIslands, + "Martinique": Martinique, + "Mauritania": Mauritania, + "Mauritius": Mauritius, + "Mayotte": Mayotte, + "Mexico": Mexico, + "Micronesia (Federated States of)": Micronesia, + "Moldova (the Republic of)": Moldova, + "Monaco": Monaco, + "Mongolia": Mongolia, + "Montenegro": Montenegro, + "Montserrat": Montserrat, + "Morocco": Morocco, + "Mozambique": Mozambique, + "Myanmar": Myanmar, + "Namibia": Namibia, + "Nauru": Nauru, + "Nepal": Nepal, + "Netherlands (the)": Netherlands, + "New Caledonia": NewCaledonia, + "New Zealand": NewZealand, + "Nicaragua": Nicaragua, + "Niger (the)": Niger, + "Nigeria": Nigeria, + "Niue": Niue, + "Norfolk Island": NorfolkIsland, + "North Macedonia": NorthMacedonia, + "Northern Mariana Islands (the)": NorthernMarianaIslands, + "Norway": Norway, + "Oman": Oman, + "Pakistan": Pakistan, + "Palau": Palau, + "Palestine, State of": Palestine, + "Panama": Panama, + "Papua New Guinea": PapuaNewGuinea, + "Paraguay": Paraguay, + "Peru": Peru, + "Philippines (the)": Philippines, + "Pitcairn": Pitcairn, + "Poland": Poland, + "Portugal": Portugal, + "Puerto Rico": PuertoRico, + "Qatar": Qatar, + "Romania": Romania, + "Russian Federation (the)": RussianFederation, + "Rwanda": Rwanda, + "Réunion": Reunion, + "Saint Barthélemy": SaintBarthelemy, + "Saint Helena, Ascension and Tristan da Cunha": SaintHelenaAscensionAndTristanDaCunha, + "Saint Kitts and Nevis": SaintKittsAndNevis, + "Saint Lucia": SaintLucia, + "Saint Martin (French part)": SaintMartin, + "Saint Pierre and Miquelon": SaintPierreAndMiquelon, + "Saint Vincent and the Grenadines": SaintVincentAndTheGrenadines, + "Samoa": Samoa, + "San Marino": SanMarino, + "Sao Tome and Principe": SaoTomeAndPrincipe, + "Saudi Arabia": SaudiArabia, + "Senegal": Senegal, + "Serbia": Serbia, + "Seychelles": Seychelles, + "Sierra Leone": SierraLeone, + "Singapore": Singapore, + "Sint Maarten (Dutch part)": SintMaarten, + "Slovakia": Slovakia, + "Slovenia": Slovenia, + "Solomon Islands": SolomonIslands, + "Somalia": Somalia, + "South Africa": SouthAfrica, + "South Georgia and the South Sandwich Islands": SouthGeorgiaAndTheSouthSandwichIslands, + "South Sudan": SouthSudan, + "Spain": Spain, + "Sri Lanka": SriLanka, + "Sudan (the)": Sudan, + "Suriname": Suriname, + "Svalbard and Jan Mayen": SvalbardAndJanMayen, + "Sweden": Sweden, + "Switzerland": Switzerland, + "Syrian Arab Republic (the)": SyrianArabRepublic, + "Taiwan (Province of China)": Taiwan, + "Tajikistan": Tajikistan, + "Tanzania, the United Republic of": TanzaniaTheUnitedRepublicOf, + "Thailand": Thailand, + "Timor-Leste": TimorLeste, + "Togo": Togo, + "Tokelau": Tokelau, + "Tonga": Tonga, + "Trinidad and Tobago": TrinidadAndTobago, + "Tunisia": Tunisia, + "Turkmenistan": Turkmenistan, + "Turks and Caicos Islands (the)": TurksAndCaicosIslands, + "Tuvalu": Tuvalu, + "Türkiye": Turkiye, + "Uganda": Uganda, + "Ukraine": Ukraine, + "United Arab Emirates (the)": UnitedArabEmirates, + "United Kingdom of Great Britain and Northern Ireland (the)": UnitedKingdomOfGreatBritainAndNorthernIreland, + "United States Minor Outlying Islands (the)": UnitedStatesMinorOutlyingIslands, + "United States of America (the)": UnitedStatesOfAmerica, + "Uruguay": Uruguay, + "Uzbekistan": Uzbekistan, + "Vanuatu": Vanuatu, + "Venezuela (Bolivarian Republic of)": Venezuela, + "Viet Nam": VietNam, + "Virgin Islands (British)": BritishVirginIslands, + "Virgin Islands (U.S.)": USVirginIslands, + "Wallis and Futuna": WallisAndFutuna, + "Western Sahara*": WesternSahara, + "Yemen": Yemen, + "Zambia": Zambia, + "Zimbabwe": Zimbabwe, + "Åland Islands": AlandIslands, } -var countryByAlpha2 = map[Alpha2Code]Country{ - Alpha2AF: Afghanistan, - Alpha2AL: Albania, - Alpha2DZ: Algeria, - Alpha2AS: AmericanSamoa, - Alpha2AD: Andorra, - Alpha2AO: Angola, - Alpha2AI: Anguilla, - Alpha2AQ: Antarctica, - Alpha2AG: AntiguaAndBarbuda, - Alpha2AR: Argentina, - Alpha2AM: Armenia, - Alpha2AW: Aruba, - Alpha2AU: Australia, - Alpha2AT: Austria, - Alpha2AZ: Azerbaijan, - Alpha2BS: Bahamas, - Alpha2BH: Bahrain, - Alpha2BD: Bangladesh, - Alpha2BB: Barbados, - Alpha2BY: Belarus, - Alpha2BE: Belgium, - Alpha2BZ: Belize, - Alpha2BJ: Benin, - Alpha2BM: Bermuda, - Alpha2BT: Bhutan, - Alpha2BO: Bolivia, - Alpha2BQ: BonaireSintEustatiusAndSaba, - Alpha2BA: BosniaAndHerzegovina, - Alpha2BW: Botswana, - Alpha2BV: BouvetIsland, - Alpha2BR: Brazil, - Alpha2IO: BritishIndianOceanTerritory, - Alpha2BN: BruneiDarussalam, - Alpha2BG: Bulgaria, - Alpha2BF: BurkinaFaso, - Alpha2BI: Burundi, - Alpha2CV: CaboVerde, - Alpha2KH: Cambodia, - Alpha2CM: Cameroon, - Alpha2CA: Canada, - Alpha2KY: CaymanIslands, - Alpha2CF: CentralAfricanRepublic, - Alpha2TD: Chad, - Alpha2CL: Chile, - Alpha2CN: China, - Alpha2CX: ChristmasIsland, - Alpha2CC: Cocos, - Alpha2CO: Colombia, - Alpha2KM: Comoros, - Alpha2CD: DemocraticRepublicOfTheCongo, - Alpha2CG: Congo, - Alpha2CK: CookIslands, - Alpha2CR: CostaRica, - Alpha2HR: Croatia, - Alpha2CU: Cuba, - Alpha2CW: Curacao, - Alpha2CY: Cyprus, - Alpha2CZ: Czechia, - Alpha2CI: CoteDIvoire, - Alpha2DK: Denmark, - Alpha2DJ: Djibouti, - Alpha2DM: Dominica, - Alpha2DO: DominicanRepublic, - Alpha2EC: Ecuador, - Alpha2EG: Egypt, - Alpha2SV: ElSalvador, - Alpha2GQ: EquatorialGuinea, - Alpha2ER: Eritrea, - Alpha2EE: Estonia, - Alpha2SZ: Eswatini, - Alpha2ET: Ethiopia, - Alpha2FK: FalklandIslands, - Alpha2FO: FaroeIslands, - Alpha2FJ: Fiji, - Alpha2FI: Finland, - Alpha2FR: France, - Alpha2GF: FrenchGuiana, - Alpha2PF: FrenchPolynesia, - Alpha2TF: FrenchSouthernTerritories, - Alpha2GA: Gabon, - Alpha2GM: Gambia, - Alpha2GE: Georgia, - Alpha2DE: Germany, - Alpha2GH: Ghana, - Alpha2GI: Gibraltar, - Alpha2GR: Greece, - Alpha2GL: Greenland, - Alpha2GD: Grenada, - Alpha2GP: Guadeloupe, - Alpha2GU: Guam, - Alpha2GT: Guatemala, - Alpha2GG: Guernsey, - Alpha2GN: Guinea, - Alpha2GW: GuineaBissau, - Alpha2GY: Guyana, - Alpha2HT: Haiti, - Alpha2HM: HeardIslandAndMcDonaldIslands, - Alpha2VA: HolySee, - Alpha2HN: Honduras, - Alpha2HK: HongKong, - Alpha2HU: Hungary, - Alpha2IS: Iceland, - Alpha2IN: India, - Alpha2ID: Indonesia, - Alpha2IR: Iran, - Alpha2IQ: Iraq, - Alpha2IE: Ireland, - Alpha2IM: IsleOfMan, - Alpha2IL: Israel, - Alpha2IT: Italy, - Alpha2JM: Jamaica, - Alpha2JP: Japan, - Alpha2JE: Jersey, - Alpha2JO: Jordan, - Alpha2KZ: Kazakhstan, - Alpha2KE: Kenya, - Alpha2KI: Kiribati, - Alpha2KP: NorthKorea, - Alpha2KR: SouthKorea, - Alpha2KW: Kuwait, - Alpha2KG: Kyrgyzstan, - Alpha2LA: LaoPeoplesDemocraticRepublic, - Alpha2LV: Latvia, - Alpha2LB: Lebanon, - Alpha2LS: Lesotho, - Alpha2LR: Liberia, - Alpha2LY: Libya, - Alpha2LI: Liechtenstein, - Alpha2LT: Lithuania, - Alpha2LU: Luxembourg, - Alpha2MO: Macao, - Alpha2MG: Madagascar, - Alpha2MW: Malawi, - Alpha2MY: Malaysia, - Alpha2MV: Maldives, - Alpha2ML: Mali, - Alpha2MT: Malta, - Alpha2MH: MarshallIslands, - Alpha2MQ: Martinique, - Alpha2MR: Mauritania, - Alpha2MU: Mauritius, - Alpha2YT: Mayotte, - Alpha2MX: Mexico, - Alpha2FM: Micronesia, - Alpha2MD: Moldova, - Alpha2MC: Monaco, - Alpha2MN: Mongolia, - Alpha2ME: Montenegro, - Alpha2MS: Montserrat, - Alpha2MA: Morocco, - Alpha2MZ: Mozambique, - Alpha2MM: Myanmar, - Alpha2NA: Namibia, - Alpha2NR: Nauru, - Alpha2NP: Nepal, - Alpha2NL: Netherlands, - Alpha2NC: NewCaledonia, - Alpha2NZ: NewZealand, - Alpha2NI: Nicaragua, - Alpha2NE: Niger, - Alpha2NG: Nigeria, - Alpha2NU: Niue, - Alpha2NF: NorfolkIsland, - Alpha2MK: NorthMacedonia, - Alpha2MP: NorthernMarianaIslands, - Alpha2NO: Norway, - Alpha2OM: Oman, - Alpha2PK: Pakistan, - Alpha2PW: Palau, - Alpha2PS: Palestine, - Alpha2PA: Panama, - Alpha2PG: PapuaNewGuinea, - Alpha2PY: Paraguay, - Alpha2PE: Peru, - Alpha2PH: Philippines, - Alpha2PN: Pitcairn, - Alpha2PL: Poland, - Alpha2PT: Portugal, - Alpha2PR: PuertoRico, - Alpha2QA: Qatar, - Alpha2RO: Romania, - Alpha2RU: RussianFederation, - Alpha2RW: Rwanda, - Alpha2RE: Reunion, - Alpha2BL: SaintBarthelemy, - Alpha2SH: SaintHelenaAscensionAndTristanDaCunha, - Alpha2KN: SaintKittsAndNevis, - Alpha2LC: SaintLucia, - Alpha2MF: SaintMartin, - Alpha2PM: SaintPierreAndMiquelon, - Alpha2VC: SaintVincentAndTheGrenadines, - Alpha2WS: Samoa, - Alpha2SM: SanMarino, - Alpha2ST: SaoTomeAndPrincipe, - Alpha2SA: SaudiArabia, - Alpha2SN: Senegal, - Alpha2RS: Serbia, - Alpha2SC: Seychelles, - Alpha2SL: SierraLeone, - Alpha2SG: Singapore, - Alpha2SX: SintMaarten, - Alpha2SK: Slovakia, - Alpha2SI: Slovenia, - Alpha2SB: SolomonIslands, - Alpha2SO: Somalia, - Alpha2ZA: SouthAfrica, - Alpha2GS: SouthGeorgiaAndTheSouthSandwichIslands, - Alpha2SS: SouthSudan, - Alpha2ES: Spain, - Alpha2LK: SriLanka, - Alpha2SD: Sudan, - Alpha2SR: Suriname, - Alpha2SJ: SvalbardAndJanMayen, - Alpha2SE: Sweden, - Alpha2CH: Switzerland, - Alpha2SY: SyrianArabRepublic, - Alpha2TW: Taiwan, - Alpha2TJ: Tajikistan, - Alpha2TZ: TanzaniaTheUnitedRepublicOf, - Alpha2TH: Thailand, - Alpha2TL: TimorLeste, - Alpha2TG: Togo, - Alpha2TK: Tokelau, - Alpha2TO: Tonga, - Alpha2TT: TrinidadAndTobago, - Alpha2TN: Tunisia, - Alpha2TR: Turkey, - Alpha2TM: Turkmenistan, - Alpha2TC: TurksAndCaicosIslands, - Alpha2TV: Tuvalu, - Alpha2UG: Uganda, - Alpha2UA: Ukraine, - Alpha2AE: UnitedArabEmirates, - Alpha2GB: UnitedKingdomOfGreatBritainAndNorthernIreland, - Alpha2UM: UnitedStatesMinorOutlyingIslands, - Alpha2US: UnitedStatesOfAmerica, - Alpha2UY: Uruguay, - Alpha2UZ: Uzbekistan, - Alpha2VU: Vanuatu, - Alpha2VE: Venezuela, - Alpha2VN: VietNam, - Alpha2VG: BritishVirginIslands, - Alpha2VI: USVirginIslands, - Alpha2WF: WallisAndFutuna, - Alpha2EH: WesternSahara, - Alpha2YE: Yemen, - Alpha2ZM: Zambia, - Alpha2ZW: Zimbabwe, - Alpha2AX: AlandIslands, +var CountryByAlpha2 = map[string]Country{ + "AF": Afghanistan, + "AL": Albania, + "DZ": Algeria, + "AS": AmericanSamoa, + "AD": Andorra, + "AO": Angola, + "AI": Anguilla, + "AQ": Antarctica, + "AG": AntiguaAndBarbuda, + "AR": Argentina, + "AM": Armenia, + "AW": Aruba, + "AU": Australia, + "AT": Austria, + "AZ": Azerbaijan, + "BS": Bahamas, + "BH": Bahrain, + "BD": Bangladesh, + "BB": Barbados, + "BY": Belarus, + "BE": Belgium, + "BZ": Belize, + "BJ": Benin, + "BM": Bermuda, + "BT": Bhutan, + "BO": Bolivia, + "BQ": BonaireSintEustatiusAndSaba, + "BA": BosniaAndHerzegovina, + "BW": Botswana, + "BV": BouvetIsland, + "BR": Brazil, + "IO": BritishIndianOceanTerritory, + "BN": BruneiDarussalam, + "BG": Bulgaria, + "BF": BurkinaFaso, + "BI": Burundi, + "CV": CaboVerde, + "KH": Cambodia, + "CM": Cameroon, + "CA": Canada, + "KY": CaymanIslands, + "CF": CentralAfricanRepublic, + "TD": Chad, + "CL": Chile, + "CN": China, + "CX": ChristmasIsland, + "CC": Cocos, + "CO": Colombia, + "KM": Comoros, + "CD": DemocraticRepublicOfTheCongo, + "CG": Congo, + "CK": CookIslands, + "CR": CostaRica, + "HR": Croatia, + "CU": Cuba, + "CW": Curacao, + "CY": Cyprus, + "CZ": Czechia, + "CI": CoteDIvoire, + "DK": Denmark, + "DJ": Djibouti, + "DM": Dominica, + "DO": DominicanRepublic, + "EC": Ecuador, + "EG": Egypt, + "SV": ElSalvador, + "GQ": EquatorialGuinea, + "ER": Eritrea, + "EE": Estonia, + "SZ": Eswatini, + "ET": Ethiopia, + "FK": FalklandIslands, + "FO": FaroeIslands, + "FJ": Fiji, + "FI": Finland, + "FR": France, + "GF": FrenchGuiana, + "PF": FrenchPolynesia, + "TF": FrenchSouthernTerritories, + "GA": Gabon, + "GM": Gambia, + "GE": Georgia, + "DE": Germany, + "GH": Ghana, + "GI": Gibraltar, + "GR": Greece, + "GL": Greenland, + "GD": Grenada, + "GP": Guadeloupe, + "GU": Guam, + "GT": Guatemala, + "GG": Guernsey, + "GN": Guinea, + "GW": GuineaBissau, + "GY": Guyana, + "HT": Haiti, + "HM": HeardIslandAndMcDonaldIslands, + "VA": HolySee, + "HN": Honduras, + "HK": HongKong, + "HU": Hungary, + "IS": Iceland, + "IN": India, + "ID": Indonesia, + "IR": Iran, + "IQ": Iraq, + "IE": Ireland, + "IM": IsleOfMan, + "IL": Israel, + "IT": Italy, + "JM": Jamaica, + "JP": Japan, + "JE": Jersey, + "JO": Jordan, + "KZ": Kazakhstan, + "KE": Kenya, + "KI": Kiribati, + "KP": NorthKorea, + "KR": SouthKorea, + "KW": Kuwait, + "KG": Kyrgyzstan, + "LA": LaoPeoplesDemocraticRepublic, + "LV": Latvia, + "LB": Lebanon, + "LS": Lesotho, + "LR": Liberia, + "LY": Libya, + "LI": Liechtenstein, + "LT": Lithuania, + "LU": Luxembourg, + "MO": Macao, + "MG": Madagascar, + "MW": Malawi, + "MY": Malaysia, + "MV": Maldives, + "ML": Mali, + "MT": Malta, + "MH": MarshallIslands, + "MQ": Martinique, + "MR": Mauritania, + "MU": Mauritius, + "YT": Mayotte, + "MX": Mexico, + "FM": Micronesia, + "MD": Moldova, + "MC": Monaco, + "MN": Mongolia, + "ME": Montenegro, + "MS": Montserrat, + "MA": Morocco, + "MZ": Mozambique, + "MM": Myanmar, + "NA": Namibia, + "NR": Nauru, + "NP": Nepal, + "NL": Netherlands, + "NC": NewCaledonia, + "NZ": NewZealand, + "NI": Nicaragua, + "NE": Niger, + "NG": Nigeria, + "NU": Niue, + "NF": NorfolkIsland, + "MK": NorthMacedonia, + "MP": NorthernMarianaIslands, + "NO": Norway, + "OM": Oman, + "PK": Pakistan, + "PW": Palau, + "PS": Palestine, + "PA": Panama, + "PG": PapuaNewGuinea, + "PY": Paraguay, + "PE": Peru, + "PH": Philippines, + "PN": Pitcairn, + "PL": Poland, + "PT": Portugal, + "PR": PuertoRico, + "QA": Qatar, + "RO": Romania, + "RU": RussianFederation, + "RW": Rwanda, + "RE": Reunion, + "BL": SaintBarthelemy, + "SH": SaintHelenaAscensionAndTristanDaCunha, + "KN": SaintKittsAndNevis, + "LC": SaintLucia, + "MF": SaintMartin, + "PM": SaintPierreAndMiquelon, + "VC": SaintVincentAndTheGrenadines, + "WS": Samoa, + "SM": SanMarino, + "ST": SaoTomeAndPrincipe, + "SA": SaudiArabia, + "SN": Senegal, + "RS": Serbia, + "SC": Seychelles, + "SL": SierraLeone, + "SG": Singapore, + "SX": SintMaarten, + "SK": Slovakia, + "SI": Slovenia, + "SB": SolomonIslands, + "SO": Somalia, + "ZA": SouthAfrica, + "GS": SouthGeorgiaAndTheSouthSandwichIslands, + "SS": SouthSudan, + "ES": Spain, + "LK": SriLanka, + "SD": Sudan, + "SR": Suriname, + "SJ": SvalbardAndJanMayen, + "SE": Sweden, + "CH": Switzerland, + "SY": SyrianArabRepublic, + "TW": Taiwan, + "TJ": Tajikistan, + "TZ": TanzaniaTheUnitedRepublicOf, + "TH": Thailand, + "TL": TimorLeste, + "TG": Togo, + "TK": Tokelau, + "TO": Tonga, + "TT": TrinidadAndTobago, + "TN": Tunisia, + "TM": Turkmenistan, + "TC": TurksAndCaicosIslands, + "TV": Tuvalu, + "TR": Turkiye, + "UG": Uganda, + "UA": Ukraine, + "AE": UnitedArabEmirates, + "GB": UnitedKingdomOfGreatBritainAndNorthernIreland, + "UM": UnitedStatesMinorOutlyingIslands, + "US": UnitedStatesOfAmerica, + "UY": Uruguay, + "UZ": Uzbekistan, + "VU": Vanuatu, + "VE": Venezuela, + "VN": VietNam, + "VG": BritishVirginIslands, + "VI": USVirginIslands, + "WF": WallisAndFutuna, + "EH": WesternSahara, + "YE": Yemen, + "ZM": Zambia, + "ZW": Zimbabwe, + "AX": AlandIslands, } -var countryByAlpha3 = map[Alpha3Code]Country{ - Alpha3AFG: Afghanistan, - Alpha3ALB: Albania, - Alpha3DZA: Algeria, - Alpha3ASM: AmericanSamoa, - Alpha3AND: Andorra, - Alpha3AGO: Angola, - Alpha3AIA: Anguilla, - Alpha3ATA: Antarctica, - Alpha3ATG: AntiguaAndBarbuda, - Alpha3ARG: Argentina, - Alpha3ARM: Armenia, - Alpha3ABW: Aruba, - Alpha3AUS: Australia, - Alpha3AUT: Austria, - Alpha3AZE: Azerbaijan, - Alpha3BHS: Bahamas, - Alpha3BHR: Bahrain, - Alpha3BGD: Bangladesh, - Alpha3BRB: Barbados, - Alpha3BLR: Belarus, - Alpha3BEL: Belgium, - Alpha3BLZ: Belize, - Alpha3BEN: Benin, - Alpha3BMU: Bermuda, - Alpha3BTN: Bhutan, - Alpha3BOL: Bolivia, - Alpha3BES: BonaireSintEustatiusAndSaba, - Alpha3BIH: BosniaAndHerzegovina, - Alpha3BWA: Botswana, - Alpha3BVT: BouvetIsland, - Alpha3BRA: Brazil, - Alpha3IOT: BritishIndianOceanTerritory, - Alpha3BRN: BruneiDarussalam, - Alpha3BGR: Bulgaria, - Alpha3BFA: BurkinaFaso, - Alpha3BDI: Burundi, - Alpha3CPV: CaboVerde, - Alpha3KHM: Cambodia, - Alpha3CMR: Cameroon, - Alpha3CAN: Canada, - Alpha3CYM: CaymanIslands, - Alpha3CAF: CentralAfricanRepublic, - Alpha3TCD: Chad, - Alpha3CHL: Chile, - Alpha3CHN: China, - Alpha3CXR: ChristmasIsland, - Alpha3CCK: Cocos, - Alpha3COL: Colombia, - Alpha3COM: Comoros, - Alpha3COD: DemocraticRepublicOfTheCongo, - Alpha3COG: Congo, - Alpha3COK: CookIslands, - Alpha3CRI: CostaRica, - Alpha3HRV: Croatia, - Alpha3CUB: Cuba, - Alpha3CUW: Curacao, - Alpha3CYP: Cyprus, - Alpha3CZE: Czechia, - Alpha3CIV: CoteDIvoire, - Alpha3DNK: Denmark, - Alpha3DJI: Djibouti, - Alpha3DMA: Dominica, - Alpha3DOM: DominicanRepublic, - Alpha3ECU: Ecuador, - Alpha3EGY: Egypt, - Alpha3SLV: ElSalvador, - Alpha3GNQ: EquatorialGuinea, - Alpha3ERI: Eritrea, - Alpha3EST: Estonia, - Alpha3SWZ: Eswatini, - Alpha3ETH: Ethiopia, - Alpha3FLK: FalklandIslands, - Alpha3FRO: FaroeIslands, - Alpha3FJI: Fiji, - Alpha3FIN: Finland, - Alpha3FRA: France, - Alpha3GUF: FrenchGuiana, - Alpha3PYF: FrenchPolynesia, - Alpha3ATF: FrenchSouthernTerritories, - Alpha3GAB: Gabon, - Alpha3GMB: Gambia, - Alpha3GEO: Georgia, - Alpha3DEU: Germany, - Alpha3GHA: Ghana, - Alpha3GIB: Gibraltar, - Alpha3GRC: Greece, - Alpha3GRL: Greenland, - Alpha3GRD: Grenada, - Alpha3GLP: Guadeloupe, - Alpha3GUM: Guam, - Alpha3GTM: Guatemala, - Alpha3GGY: Guernsey, - Alpha3GIN: Guinea, - Alpha3GNB: GuineaBissau, - Alpha3GUY: Guyana, - Alpha3HTI: Haiti, - Alpha3HMD: HeardIslandAndMcDonaldIslands, - Alpha3VAT: HolySee, - Alpha3HND: Honduras, - Alpha3HKG: HongKong, - Alpha3HUN: Hungary, - Alpha3ISL: Iceland, - Alpha3IND: India, - Alpha3IDN: Indonesia, - Alpha3IRN: Iran, - Alpha3IRQ: Iraq, - Alpha3IRL: Ireland, - Alpha3IMN: IsleOfMan, - Alpha3ISR: Israel, - Alpha3ITA: Italy, - Alpha3JAM: Jamaica, - Alpha3JPN: Japan, - Alpha3JEY: Jersey, - Alpha3JOR: Jordan, - Alpha3KAZ: Kazakhstan, - Alpha3KEN: Kenya, - Alpha3KIR: Kiribati, - Alpha3PRK: NorthKorea, - Alpha3KOR: SouthKorea, - Alpha3KWT: Kuwait, - Alpha3KGZ: Kyrgyzstan, - Alpha3LAO: LaoPeoplesDemocraticRepublic, - Alpha3LVA: Latvia, - Alpha3LBN: Lebanon, - Alpha3LSO: Lesotho, - Alpha3LBR: Liberia, - Alpha3LBY: Libya, - Alpha3LIE: Liechtenstein, - Alpha3LTU: Lithuania, - Alpha3LUX: Luxembourg, - Alpha3MAC: Macao, - Alpha3MDG: Madagascar, - Alpha3MWI: Malawi, - Alpha3MYS: Malaysia, - Alpha3MDV: Maldives, - Alpha3MLI: Mali, - Alpha3MLT: Malta, - Alpha3MHL: MarshallIslands, - Alpha3MTQ: Martinique, - Alpha3MRT: Mauritania, - Alpha3MUS: Mauritius, - Alpha3MYT: Mayotte, - Alpha3MEX: Mexico, - Alpha3FSM: Micronesia, - Alpha3MDA: Moldova, - Alpha3MCO: Monaco, - Alpha3MNG: Mongolia, - Alpha3MNE: Montenegro, - Alpha3MSR: Montserrat, - Alpha3MAR: Morocco, - Alpha3MOZ: Mozambique, - Alpha3MMR: Myanmar, - Alpha3NAM: Namibia, - Alpha3NRU: Nauru, - Alpha3NPL: Nepal, - Alpha3NLD: Netherlands, - Alpha3NCL: NewCaledonia, - Alpha3NZL: NewZealand, - Alpha3NIC: Nicaragua, - Alpha3NER: Niger, - Alpha3NGA: Nigeria, - Alpha3NIU: Niue, - Alpha3NFK: NorfolkIsland, - Alpha3MKD: NorthMacedonia, - Alpha3MNP: NorthernMarianaIslands, - Alpha3NOR: Norway, - Alpha3OMN: Oman, - Alpha3PAK: Pakistan, - Alpha3PLW: Palau, - Alpha3PSE: Palestine, - Alpha3PAN: Panama, - Alpha3PNG: PapuaNewGuinea, - Alpha3PRY: Paraguay, - Alpha3PER: Peru, - Alpha3PHL: Philippines, - Alpha3PCN: Pitcairn, - Alpha3POL: Poland, - Alpha3PRT: Portugal, - Alpha3PRI: PuertoRico, - Alpha3QAT: Qatar, - Alpha3ROU: Romania, - Alpha3RUS: RussianFederation, - Alpha3RWA: Rwanda, - Alpha3REU: Reunion, - Alpha3BLM: SaintBarthelemy, - Alpha3SHN: SaintHelenaAscensionAndTristanDaCunha, - Alpha3KNA: SaintKittsAndNevis, - Alpha3LCA: SaintLucia, - Alpha3MAF: SaintMartin, - Alpha3SPM: SaintPierreAndMiquelon, - Alpha3VCT: SaintVincentAndTheGrenadines, - Alpha3WSM: Samoa, - Alpha3SMR: SanMarino, - Alpha3STP: SaoTomeAndPrincipe, - Alpha3SAU: SaudiArabia, - Alpha3SEN: Senegal, - Alpha3SRB: Serbia, - Alpha3SYC: Seychelles, - Alpha3SLE: SierraLeone, - Alpha3SGP: Singapore, - Alpha3SXM: SintMaarten, - Alpha3SVK: Slovakia, - Alpha3SVN: Slovenia, - Alpha3SLB: SolomonIslands, - Alpha3SOM: Somalia, - Alpha3ZAF: SouthAfrica, - Alpha3SGS: SouthGeorgiaAndTheSouthSandwichIslands, - Alpha3SSD: SouthSudan, - Alpha3ESP: Spain, - Alpha3LKA: SriLanka, - Alpha3SDN: Sudan, - Alpha3SUR: Suriname, - Alpha3SJM: SvalbardAndJanMayen, - Alpha3SWE: Sweden, - Alpha3CHE: Switzerland, - Alpha3SYR: SyrianArabRepublic, - Alpha3TWN: Taiwan, - Alpha3TJK: Tajikistan, - Alpha3TZA: TanzaniaTheUnitedRepublicOf, - Alpha3THA: Thailand, - Alpha3TLS: TimorLeste, - Alpha3TGO: Togo, - Alpha3TKL: Tokelau, - Alpha3TON: Tonga, - Alpha3TTO: TrinidadAndTobago, - Alpha3TUN: Tunisia, - Alpha3TUR: Turkey, - Alpha3TKM: Turkmenistan, - Alpha3TCA: TurksAndCaicosIslands, - Alpha3TUV: Tuvalu, - Alpha3UGA: Uganda, - Alpha3UKR: Ukraine, - Alpha3ARE: UnitedArabEmirates, - Alpha3GBR: UnitedKingdomOfGreatBritainAndNorthernIreland, - Alpha3UMI: UnitedStatesMinorOutlyingIslands, - Alpha3USA: UnitedStatesOfAmerica, - Alpha3URY: Uruguay, - Alpha3UZB: Uzbekistan, - Alpha3VUT: Vanuatu, - Alpha3VEN: Venezuela, - Alpha3VNM: VietNam, - Alpha3VGB: BritishVirginIslands, - Alpha3VIR: USVirginIslands, - Alpha3WLF: WallisAndFutuna, - Alpha3ESH: WesternSahara, - Alpha3YEM: Yemen, - Alpha3ZMB: Zambia, - Alpha3ZWE: Zimbabwe, - Alpha3ALA: AlandIslands, +var CountryByAlpha3 = map[string]Country{ + "AFG": Afghanistan, + "ALB": Albania, + "DZA": Algeria, + "ASM": AmericanSamoa, + "AND": Andorra, + "AGO": Angola, + "AIA": Anguilla, + "ATA": Antarctica, + "ATG": AntiguaAndBarbuda, + "ARG": Argentina, + "ARM": Armenia, + "ABW": Aruba, + "AUS": Australia, + "AUT": Austria, + "AZE": Azerbaijan, + "BHS": Bahamas, + "BHR": Bahrain, + "BGD": Bangladesh, + "BRB": Barbados, + "BLR": Belarus, + "BEL": Belgium, + "BLZ": Belize, + "BEN": Benin, + "BMU": Bermuda, + "BTN": Bhutan, + "BOL": Bolivia, + "BES": BonaireSintEustatiusAndSaba, + "BIH": BosniaAndHerzegovina, + "BWA": Botswana, + "BVT": BouvetIsland, + "BRA": Brazil, + "IOT": BritishIndianOceanTerritory, + "BRN": BruneiDarussalam, + "BGR": Bulgaria, + "BFA": BurkinaFaso, + "BDI": Burundi, + "CPV": CaboVerde, + "KHM": Cambodia, + "CMR": Cameroon, + "CAN": Canada, + "CYM": CaymanIslands, + "CAF": CentralAfricanRepublic, + "TCD": Chad, + "CHL": Chile, + "CHN": China, + "CXR": ChristmasIsland, + "CCK": Cocos, + "COL": Colombia, + "COM": Comoros, + "COD": DemocraticRepublicOfTheCongo, + "COG": Congo, + "COK": CookIslands, + "CRI": CostaRica, + "HRV": Croatia, + "CUB": Cuba, + "CUW": Curacao, + "CYP": Cyprus, + "CZE": Czechia, + "CIV": CoteDIvoire, + "DNK": Denmark, + "DJI": Djibouti, + "DMA": Dominica, + "DOM": DominicanRepublic, + "ECU": Ecuador, + "EGY": Egypt, + "SLV": ElSalvador, + "GNQ": EquatorialGuinea, + "ERI": Eritrea, + "EST": Estonia, + "SWZ": Eswatini, + "ETH": Ethiopia, + "FLK": FalklandIslands, + "FRO": FaroeIslands, + "FJI": Fiji, + "FIN": Finland, + "FRA": France, + "GUF": FrenchGuiana, + "PYF": FrenchPolynesia, + "ATF": FrenchSouthernTerritories, + "GAB": Gabon, + "GMB": Gambia, + "GEO": Georgia, + "DEU": Germany, + "GHA": Ghana, + "GIB": Gibraltar, + "GRC": Greece, + "GRL": Greenland, + "GRD": Grenada, + "GLP": Guadeloupe, + "GUM": Guam, + "GTM": Guatemala, + "GGY": Guernsey, + "GIN": Guinea, + "GNB": GuineaBissau, + "GUY": Guyana, + "HTI": Haiti, + "HMD": HeardIslandAndMcDonaldIslands, + "VAT": HolySee, + "HND": Honduras, + "HKG": HongKong, + "HUN": Hungary, + "ISL": Iceland, + "IND": India, + "IDN": Indonesia, + "IRN": Iran, + "IRQ": Iraq, + "IRL": Ireland, + "IMN": IsleOfMan, + "ISR": Israel, + "ITA": Italy, + "JAM": Jamaica, + "JPN": Japan, + "JEY": Jersey, + "JOR": Jordan, + "KAZ": Kazakhstan, + "KEN": Kenya, + "KIR": Kiribati, + "PRK": NorthKorea, + "KOR": SouthKorea, + "KWT": Kuwait, + "KGZ": Kyrgyzstan, + "LAO": LaoPeoplesDemocraticRepublic, + "LVA": Latvia, + "LBN": Lebanon, + "LSO": Lesotho, + "LBR": Liberia, + "LBY": Libya, + "LIE": Liechtenstein, + "LTU": Lithuania, + "LUX": Luxembourg, + "MAC": Macao, + "MDG": Madagascar, + "MWI": Malawi, + "MYS": Malaysia, + "MDV": Maldives, + "MLI": Mali, + "MLT": Malta, + "MHL": MarshallIslands, + "MTQ": Martinique, + "MRT": Mauritania, + "MUS": Mauritius, + "MYT": Mayotte, + "MEX": Mexico, + "FSM": Micronesia, + "MDA": Moldova, + "MCO": Monaco, + "MNG": Mongolia, + "MNE": Montenegro, + "MSR": Montserrat, + "MAR": Morocco, + "MOZ": Mozambique, + "MMR": Myanmar, + "NAM": Namibia, + "NRU": Nauru, + "NPL": Nepal, + "NLD": Netherlands, + "NCL": NewCaledonia, + "NZL": NewZealand, + "NIC": Nicaragua, + "NER": Niger, + "NGA": Nigeria, + "NIU": Niue, + "NFK": NorfolkIsland, + "MKD": NorthMacedonia, + "MNP": NorthernMarianaIslands, + "NOR": Norway, + "OMN": Oman, + "PAK": Pakistan, + "PLW": Palau, + "PSE": Palestine, + "PAN": Panama, + "PNG": PapuaNewGuinea, + "PRY": Paraguay, + "PER": Peru, + "PHL": Philippines, + "PCN": Pitcairn, + "POL": Poland, + "PRT": Portugal, + "PRI": PuertoRico, + "QAT": Qatar, + "ROU": Romania, + "RUS": RussianFederation, + "RWA": Rwanda, + "REU": Reunion, + "BLM": SaintBarthelemy, + "SHN": SaintHelenaAscensionAndTristanDaCunha, + "KNA": SaintKittsAndNevis, + "LCA": SaintLucia, + "MAF": SaintMartin, + "SPM": SaintPierreAndMiquelon, + "VCT": SaintVincentAndTheGrenadines, + "WSM": Samoa, + "SMR": SanMarino, + "STP": SaoTomeAndPrincipe, + "SAU": SaudiArabia, + "SEN": Senegal, + "SRB": Serbia, + "SYC": Seychelles, + "SLE": SierraLeone, + "SGP": Singapore, + "SXM": SintMaarten, + "SVK": Slovakia, + "SVN": Slovenia, + "SLB": SolomonIslands, + "SOM": Somalia, + "ZAF": SouthAfrica, + "SGS": SouthGeorgiaAndTheSouthSandwichIslands, + "SSD": SouthSudan, + "ESP": Spain, + "LKA": SriLanka, + "SDN": Sudan, + "SUR": Suriname, + "SJM": SvalbardAndJanMayen, + "SWE": Sweden, + "CHE": Switzerland, + "SYR": SyrianArabRepublic, + "TWN": Taiwan, + "TJK": Tajikistan, + "TZA": TanzaniaTheUnitedRepublicOf, + "THA": Thailand, + "TLS": TimorLeste, + "TGO": Togo, + "TKL": Tokelau, + "TON": Tonga, + "TTO": TrinidadAndTobago, + "TUN": Tunisia, + "TKM": Turkmenistan, + "TCA": TurksAndCaicosIslands, + "TUV": Tuvalu, + "TUR": Turkiye, + "UGA": Uganda, + "UKR": Ukraine, + "ARE": UnitedArabEmirates, + "GBR": UnitedKingdomOfGreatBritainAndNorthernIreland, + "UMI": UnitedStatesMinorOutlyingIslands, + "USA": UnitedStatesOfAmerica, + "URY": Uruguay, + "UZB": Uzbekistan, + "VUT": Vanuatu, + "VEN": Venezuela, + "VNM": VietNam, + "VGB": BritishVirginIslands, + "VIR": USVirginIslands, + "WLF": WallisAndFutuna, + "ESH": WesternSahara, + "YEM": Yemen, + "ZMB": Zambia, + "ZWE": Zimbabwe, + "ALA": AlandIslands, } diff --git a/country/country_test.go b/country/country_test.go index 959bc93..49f0096 100644 --- a/country/country_test.go +++ b/country/country_test.go @@ -8,8 +8,8 @@ import ( ) func TestCountryByNameIsSet(t *testing.T) { - for key, country := range countryByName { - if !key.IsSet() { + for key, country := range CountryByName { + if !Name(key).IsSet() { t.FailNow() } @@ -28,8 +28,8 @@ func TestCountryByNameIsSet(t *testing.T) { } func TestCountryByAlpha3IsSet(t *testing.T) { - for key, country := range countryByAlpha3 { - if !key.IsSet() { + for key, country := range CountryByAlpha3 { + if !Alpha3Code(key).IsSet() { t.FailNow() } @@ -48,8 +48,8 @@ func TestCountryByAlpha3IsSet(t *testing.T) { } func TestCountryByAlpha2IsSet(t *testing.T) { - for key, country := range countryByAlpha2 { - if !key.IsSet() { + for key, country := range CountryByAlpha2 { + if !Alpha2Code(key).IsSet() { t.FailNow() } @@ -82,48 +82,48 @@ func TestIsNotSet(t *testing.T) { } func TestMappingIsCorrect(t *testing.T) { - for key, country := range countryByName { - if key != country.name { + for key, country := range CountryByName { + if Name(key) != country.name { t.FailNow() } } - for key, country := range countryByAlpha3 { - if key != country.alpha3 { + for key, country := range CountryByAlpha3 { + if Alpha3Code(key) != country.alpha3 { t.FailNow() } } - for key, country := range countryByAlpha2 { - if key != country.alpha2 { + for key, country := range CountryByAlpha2 { + if Alpha2Code(key) != country.alpha2 { t.FailNow() } } } func TestMappingStringsCorrect(t *testing.T) { - for key, country := range countryByName { - if key.String() != country.name.String() { + for key, country := range CountryByName { + if Name(key).String() != country.name.String() { t.FailNow() } } - for key, country := range countryByAlpha3 { - if key.String() != country.alpha3.String() { + for key, country := range CountryByAlpha3 { + if Alpha3Code(key).String() != country.alpha3.String() { t.FailNow() } } - for key, country := range countryByAlpha2 { - if key.String() != country.alpha2.String() { + for key, country := range CountryByAlpha2 { + if Alpha2Code(key).String() != country.alpha2.String() { t.FailNow() } } } func TestMappingValueCorrect(t *testing.T) { - for key, country := range countryByName { - _, actual := key.Value() + for key, country := range CountryByName { + _, actual := Name(key).Value() _, expected := country.name.Value() if actual != expected { @@ -131,8 +131,8 @@ func TestMappingValueCorrect(t *testing.T) { } } - for key, country := range countryByAlpha3 { - _, actual := key.Value() + for key, country := range CountryByAlpha3 { + _, actual := Alpha3Code(key).Value() _, expected := country.name.Value() if actual != expected { @@ -140,8 +140,8 @@ func TestMappingValueCorrect(t *testing.T) { } } - for key, country := range countryByAlpha2 { - _, actual := key.Value() + for key, country := range CountryByAlpha2 { + _, actual := Alpha2Code(key).Value() _, expected := country.name.Value() if actual != expected { @@ -176,7 +176,7 @@ func TestNameValidate(t *testing.T) { t.FailNow() } - if NameBrazil.Validate() != nil { + if Name("Brazil").Validate() != nil { t.FailNow() } } @@ -186,7 +186,7 @@ func TestAlpha2Validate(t *testing.T) { t.FailNow() } - if Alpha2CM.Validate() != nil { + if Alpha2Code("CM").Validate() != nil { t.FailNow() } } @@ -196,13 +196,13 @@ func TestAlpha3Validate(t *testing.T) { t.FailNow() } - if Alpha3ARG.Validate() != nil { + if Alpha3Code("ARG").Validate() != nil { t.FailNow() } } func TestCountryTypes(t *testing.T) { - for _, country := range countryByAlpha3 { + for _, country := range CountryByAlpha3 { if country.name != country.Name() { t.FailNow() } @@ -336,7 +336,7 @@ func TestNameLookup(t *testing.T) { } func TestDriverValue(t *testing.T) { - if value, err := Alpha2US.Value(); err != nil || value.(string) != Alpha2US.String() { + if value, err := Alpha2Code("US").Value(); err != nil || value.(string) != Alpha2Code("US").String() { t.FailNow() } @@ -348,7 +348,7 @@ func TestDriverValue(t *testing.T) { t.FailNow() } - if value, err := Alpha3USA.Value(); err != nil || value.(string) != Alpha3USA.String() { + if value, err := Alpha3Code("USA").Value(); err != nil || value.(string) != Alpha3Code("USA").String() { t.FailNow() } @@ -360,7 +360,7 @@ func TestDriverValue(t *testing.T) { t.FailNow() } - if value, err := NameUnitedStatesOfAmerica.Value(); err != nil || value.(string) != NameUnitedStatesOfAmerica.String() { + if value, err := Name("United States of America (the)").Value(); err != nil || value.(string) != Name("United States of America (the)").String() { t.FailNow() } diff --git a/country/entities_gen.go b/country/entities_gen.go index 1f4c87d..2160cf5 100644 --- a/country/entities_gen.go +++ b/country/entities_gen.go @@ -1,1498 +1,1498 @@ package country var ( - //Afghanistan represents 'Afghanistan' country + // Afghanistan represents 'Afghanistan' country Afghanistan = Country{ - name: NameAfghanistan, - alpha2: Alpha2AF, - alpha3: Alpha3AFG, + name: "Afghanistan", + alpha2: "AF", + alpha3: "AFG", } - //Albania represents 'Albania' country + // Albania represents 'Albania' country Albania = Country{ - name: NameAlbania, - alpha2: Alpha2AL, - alpha3: Alpha3ALB, + name: "Albania", + alpha2: "AL", + alpha3: "ALB", } - //Algeria represents 'Algeria' country + // Algeria represents 'Algeria' country Algeria = Country{ - name: NameAlgeria, - alpha2: Alpha2DZ, - alpha3: Alpha3DZA, + name: "Algeria", + alpha2: "DZ", + alpha3: "DZA", } - //AmericanSamoa represents 'American Samoa' country + // AmericanSamoa represents 'American Samoa' country AmericanSamoa = Country{ - name: NameAmericanSamoa, - alpha2: Alpha2AS, - alpha3: Alpha3ASM, + name: "American Samoa", + alpha2: "AS", + alpha3: "ASM", } - //Andorra represents 'Andorra' country + // Andorra represents 'Andorra' country Andorra = Country{ - name: NameAndorra, - alpha2: Alpha2AD, - alpha3: Alpha3AND, + name: "Andorra", + alpha2: "AD", + alpha3: "AND", } - //Angola represents 'Angola' country + // Angola represents 'Angola' country Angola = Country{ - name: NameAngola, - alpha2: Alpha2AO, - alpha3: Alpha3AGO, + name: "Angola", + alpha2: "AO", + alpha3: "AGO", } - //Anguilla represents 'Anguilla' country + // Anguilla represents 'Anguilla' country Anguilla = Country{ - name: NameAnguilla, - alpha2: Alpha2AI, - alpha3: Alpha3AIA, + name: "Anguilla", + alpha2: "AI", + alpha3: "AIA", } - //Antarctica represents 'Antarctica' country + // Antarctica represents 'Antarctica' country Antarctica = Country{ - name: NameAntarctica, - alpha2: Alpha2AQ, - alpha3: Alpha3ATA, + name: "Antarctica", + alpha2: "AQ", + alpha3: "ATA", } - //AntiguaAndBarbuda represents 'Antigua and Barbuda' country + // AntiguaAndBarbuda represents 'Antigua and Barbuda' country AntiguaAndBarbuda = Country{ - name: NameAntiguaAndBarbuda, - alpha2: Alpha2AG, - alpha3: Alpha3ATG, + name: "Antigua and Barbuda", + alpha2: "AG", + alpha3: "ATG", } - //Argentina represents 'Argentina' country + // Argentina represents 'Argentina' country Argentina = Country{ - name: NameArgentina, - alpha2: Alpha2AR, - alpha3: Alpha3ARG, + name: "Argentina", + alpha2: "AR", + alpha3: "ARG", } - //Armenia represents 'Armenia' country + // Armenia represents 'Armenia' country Armenia = Country{ - name: NameArmenia, - alpha2: Alpha2AM, - alpha3: Alpha3ARM, + name: "Armenia", + alpha2: "AM", + alpha3: "ARM", } - //Aruba represents 'Aruba' country + // Aruba represents 'Aruba' country Aruba = Country{ - name: NameAruba, - alpha2: Alpha2AW, - alpha3: Alpha3ABW, + name: "Aruba", + alpha2: "AW", + alpha3: "ABW", } - //Australia represents 'Australia' country + // Australia represents 'Australia' country Australia = Country{ - name: NameAustralia, - alpha2: Alpha2AU, - alpha3: Alpha3AUS, + name: "Australia", + alpha2: "AU", + alpha3: "AUS", } - //Austria represents 'Austria' country + // Austria represents 'Austria' country Austria = Country{ - name: NameAustria, - alpha2: Alpha2AT, - alpha3: Alpha3AUT, + name: "Austria", + alpha2: "AT", + alpha3: "AUT", } - //Azerbaijan represents 'Azerbaijan' country + // Azerbaijan represents 'Azerbaijan' country Azerbaijan = Country{ - name: NameAzerbaijan, - alpha2: Alpha2AZ, - alpha3: Alpha3AZE, + name: "Azerbaijan", + alpha2: "AZ", + alpha3: "AZE", } - //Bahamas represents 'Bahamas (the)' country + // Bahamas represents 'Bahamas (the)' country Bahamas = Country{ - name: NameBahamas, - alpha2: Alpha2BS, - alpha3: Alpha3BHS, + name: "Bahamas (the)", + alpha2: "BS", + alpha3: "BHS", } - //Bahrain represents 'Bahrain' country + // Bahrain represents 'Bahrain' country Bahrain = Country{ - name: NameBahrain, - alpha2: Alpha2BH, - alpha3: Alpha3BHR, + name: "Bahrain", + alpha2: "BH", + alpha3: "BHR", } - //Bangladesh represents 'Bangladesh' country + // Bangladesh represents 'Bangladesh' country Bangladesh = Country{ - name: NameBangladesh, - alpha2: Alpha2BD, - alpha3: Alpha3BGD, + name: "Bangladesh", + alpha2: "BD", + alpha3: "BGD", } - //Barbados represents 'Barbados' country + // Barbados represents 'Barbados' country Barbados = Country{ - name: NameBarbados, - alpha2: Alpha2BB, - alpha3: Alpha3BRB, + name: "Barbados", + alpha2: "BB", + alpha3: "BRB", } - //Belarus represents 'Belarus' country + // Belarus represents 'Belarus' country Belarus = Country{ - name: NameBelarus, - alpha2: Alpha2BY, - alpha3: Alpha3BLR, + name: "Belarus", + alpha2: "BY", + alpha3: "BLR", } - //Belgium represents 'Belgium' country + // Belgium represents 'Belgium' country Belgium = Country{ - name: NameBelgium, - alpha2: Alpha2BE, - alpha3: Alpha3BEL, + name: "Belgium", + alpha2: "BE", + alpha3: "BEL", } - //Belize represents 'Belize' country + // Belize represents 'Belize' country Belize = Country{ - name: NameBelize, - alpha2: Alpha2BZ, - alpha3: Alpha3BLZ, + name: "Belize", + alpha2: "BZ", + alpha3: "BLZ", } - //Benin represents 'Benin' country + // Benin represents 'Benin' country Benin = Country{ - name: NameBenin, - alpha2: Alpha2BJ, - alpha3: Alpha3BEN, + name: "Benin", + alpha2: "BJ", + alpha3: "BEN", } - //Bermuda represents 'Bermuda' country + // Bermuda represents 'Bermuda' country Bermuda = Country{ - name: NameBermuda, - alpha2: Alpha2BM, - alpha3: Alpha3BMU, + name: "Bermuda", + alpha2: "BM", + alpha3: "BMU", } - //Bhutan represents 'Bhutan' country + // Bhutan represents 'Bhutan' country Bhutan = Country{ - name: NameBhutan, - alpha2: Alpha2BT, - alpha3: Alpha3BTN, + name: "Bhutan", + alpha2: "BT", + alpha3: "BTN", } - //Bolivia represents 'Bolivia (Plurinational State of)' country + // Bolivia represents 'Bolivia (Plurinational State of)' country Bolivia = Country{ - name: NameBolivia, - alpha2: Alpha2BO, - alpha3: Alpha3BOL, + name: "Bolivia (Plurinational State of)", + alpha2: "BO", + alpha3: "BOL", } - //BonaireSintEustatiusAndSaba represents 'Bonaire, Sint Eustatius and Saba' country + // BonaireSintEustatiusAndSaba represents 'Bonaire, Sint Eustatius and Saba' country BonaireSintEustatiusAndSaba = Country{ - name: NameBonaireSintEustatiusAndSaba, - alpha2: Alpha2BQ, - alpha3: Alpha3BES, + name: "Bonaire, Sint Eustatius and Saba", + alpha2: "BQ", + alpha3: "BES", } - //BosniaAndHerzegovina represents 'Bosnia and Herzegovina' country + // BosniaAndHerzegovina represents 'Bosnia and Herzegovina' country BosniaAndHerzegovina = Country{ - name: NameBosniaAndHerzegovina, - alpha2: Alpha2BA, - alpha3: Alpha3BIH, + name: "Bosnia and Herzegovina", + alpha2: "BA", + alpha3: "BIH", } - //Botswana represents 'Botswana' country + // Botswana represents 'Botswana' country Botswana = Country{ - name: NameBotswana, - alpha2: Alpha2BW, - alpha3: Alpha3BWA, + name: "Botswana", + alpha2: "BW", + alpha3: "BWA", } - //BouvetIsland represents 'Bouvet Island' country + // BouvetIsland represents 'Bouvet Island' country BouvetIsland = Country{ - name: NameBouvetIsland, - alpha2: Alpha2BV, - alpha3: Alpha3BVT, + name: "Bouvet Island", + alpha2: "BV", + alpha3: "BVT", } - //Brazil represents 'Brazil' country + // Brazil represents 'Brazil' country Brazil = Country{ - name: NameBrazil, - alpha2: Alpha2BR, - alpha3: Alpha3BRA, + name: "Brazil", + alpha2: "BR", + alpha3: "BRA", } - //BritishIndianOceanTerritory represents 'British Indian Ocean Territory (the)' country + // BritishIndianOceanTerritory represents 'British Indian Ocean Territory (the)' country BritishIndianOceanTerritory = Country{ - name: NameBritishIndianOceanTerritory, - alpha2: Alpha2IO, - alpha3: Alpha3IOT, + name: "British Indian Ocean Territory (the)", + alpha2: "IO", + alpha3: "IOT", } - //BruneiDarussalam represents 'Brunei Darussalam' country + // BruneiDarussalam represents 'Brunei Darussalam' country BruneiDarussalam = Country{ - name: NameBruneiDarussalam, - alpha2: Alpha2BN, - alpha3: Alpha3BRN, + name: "Brunei Darussalam", + alpha2: "BN", + alpha3: "BRN", } - //Bulgaria represents 'Bulgaria' country + // Bulgaria represents 'Bulgaria' country Bulgaria = Country{ - name: NameBulgaria, - alpha2: Alpha2BG, - alpha3: Alpha3BGR, + name: "Bulgaria", + alpha2: "BG", + alpha3: "BGR", } - //BurkinaFaso represents 'Burkina Faso' country + // BurkinaFaso represents 'Burkina Faso' country BurkinaFaso = Country{ - name: NameBurkinaFaso, - alpha2: Alpha2BF, - alpha3: Alpha3BFA, + name: "Burkina Faso", + alpha2: "BF", + alpha3: "BFA", } - //Burundi represents 'Burundi' country + // Burundi represents 'Burundi' country Burundi = Country{ - name: NameBurundi, - alpha2: Alpha2BI, - alpha3: Alpha3BDI, + name: "Burundi", + alpha2: "BI", + alpha3: "BDI", } - //CaboVerde represents 'Cabo Verde' country + // CaboVerde represents 'Cabo Verde' country CaboVerde = Country{ - name: NameCaboVerde, - alpha2: Alpha2CV, - alpha3: Alpha3CPV, + name: "Cabo Verde", + alpha2: "CV", + alpha3: "CPV", } - //Cambodia represents 'Cambodia' country + // Cambodia represents 'Cambodia' country Cambodia = Country{ - name: NameCambodia, - alpha2: Alpha2KH, - alpha3: Alpha3KHM, + name: "Cambodia", + alpha2: "KH", + alpha3: "KHM", } - //Cameroon represents 'Cameroon' country + // Cameroon represents 'Cameroon' country Cameroon = Country{ - name: NameCameroon, - alpha2: Alpha2CM, - alpha3: Alpha3CMR, + name: "Cameroon", + alpha2: "CM", + alpha3: "CMR", } - //Canada represents 'Canada' country + // Canada represents 'Canada' country Canada = Country{ - name: NameCanada, - alpha2: Alpha2CA, - alpha3: Alpha3CAN, + name: "Canada", + alpha2: "CA", + alpha3: "CAN", } - //CaymanIslands represents 'Cayman Islands (the)' country + // CaymanIslands represents 'Cayman Islands (the)' country CaymanIslands = Country{ - name: NameCaymanIslands, - alpha2: Alpha2KY, - alpha3: Alpha3CYM, + name: "Cayman Islands (the)", + alpha2: "KY", + alpha3: "CYM", } - //CentralAfricanRepublic represents 'Central African Republic (the)' country + // CentralAfricanRepublic represents 'Central African Republic (the)' country CentralAfricanRepublic = Country{ - name: NameCentralAfricanRepublic, - alpha2: Alpha2CF, - alpha3: Alpha3CAF, + name: "Central African Republic (the)", + alpha2: "CF", + alpha3: "CAF", } - //Chad represents 'Chad' country + // Chad represents 'Chad' country Chad = Country{ - name: NameChad, - alpha2: Alpha2TD, - alpha3: Alpha3TCD, + name: "Chad", + alpha2: "TD", + alpha3: "TCD", } - //Chile represents 'Chile' country + // Chile represents 'Chile' country Chile = Country{ - name: NameChile, - alpha2: Alpha2CL, - alpha3: Alpha3CHL, + name: "Chile", + alpha2: "CL", + alpha3: "CHL", } - //China represents 'China' country + // China represents 'China' country China = Country{ - name: NameChina, - alpha2: Alpha2CN, - alpha3: Alpha3CHN, + name: "China", + alpha2: "CN", + alpha3: "CHN", } - //ChristmasIsland represents 'Christmas Island' country + // ChristmasIsland represents 'Christmas Island' country ChristmasIsland = Country{ - name: NameChristmasIsland, - alpha2: Alpha2CX, - alpha3: Alpha3CXR, + name: "Christmas Island", + alpha2: "CX", + alpha3: "CXR", } - //Cocos represents 'Cocos (Keeling) Islands (the)' country + // Cocos represents 'Cocos (Keeling) Islands (the)' country Cocos = Country{ - name: NameCocos, - alpha2: Alpha2CC, - alpha3: Alpha3CCK, + name: "Cocos (Keeling) Islands (the)", + alpha2: "CC", + alpha3: "CCK", } - //Colombia represents 'Colombia' country + // Colombia represents 'Colombia' country Colombia = Country{ - name: NameColombia, - alpha2: Alpha2CO, - alpha3: Alpha3COL, + name: "Colombia", + alpha2: "CO", + alpha3: "COL", } - //Comoros represents 'Comoros (the)' country + // Comoros represents 'Comoros (the)' country Comoros = Country{ - name: NameComoros, - alpha2: Alpha2KM, - alpha3: Alpha3COM, + name: "Comoros (the)", + alpha2: "KM", + alpha3: "COM", } - //DemocraticRepublicOfTheCongo represents 'Congo (the Democratic Republic of the)' country + // DemocraticRepublicOfTheCongo represents 'Congo (the Democratic Republic of the)' country DemocraticRepublicOfTheCongo = Country{ - name: NameDemocraticRepublicOfTheCongo, - alpha2: Alpha2CD, - alpha3: Alpha3COD, + name: "Congo (the Democratic Republic of the)", + alpha2: "CD", + alpha3: "COD", } - //Congo represents 'Congo (the)' country + // Congo represents 'Congo (the)' country Congo = Country{ - name: NameCongo, - alpha2: Alpha2CG, - alpha3: Alpha3COG, + name: "Congo (the)", + alpha2: "CG", + alpha3: "COG", } - //CookIslands represents 'Cook Islands (the)' country + // CookIslands represents 'Cook Islands (the)' country CookIslands = Country{ - name: NameCookIslands, - alpha2: Alpha2CK, - alpha3: Alpha3COK, + name: "Cook Islands (the)", + alpha2: "CK", + alpha3: "COK", } - //CostaRica represents 'Costa Rica' country + // CostaRica represents 'Costa Rica' country CostaRica = Country{ - name: NameCostaRica, - alpha2: Alpha2CR, - alpha3: Alpha3CRI, + name: "Costa Rica", + alpha2: "CR", + alpha3: "CRI", } - //Croatia represents 'Croatia' country + // Croatia represents 'Croatia' country Croatia = Country{ - name: NameCroatia, - alpha2: Alpha2HR, - alpha3: Alpha3HRV, + name: "Croatia", + alpha2: "HR", + alpha3: "HRV", } - //Cuba represents 'Cuba' country + // Cuba represents 'Cuba' country Cuba = Country{ - name: NameCuba, - alpha2: Alpha2CU, - alpha3: Alpha3CUB, + name: "Cuba", + alpha2: "CU", + alpha3: "CUB", } - //Curacao represents 'Curaçao' country + // Curacao represents 'Curaçao' country Curacao = Country{ - name: NameCuracao, - alpha2: Alpha2CW, - alpha3: Alpha3CUW, + name: "Curaçao", + alpha2: "CW", + alpha3: "CUW", } - //Cyprus represents 'Cyprus' country + // Cyprus represents 'Cyprus' country Cyprus = Country{ - name: NameCyprus, - alpha2: Alpha2CY, - alpha3: Alpha3CYP, + name: "Cyprus", + alpha2: "CY", + alpha3: "CYP", } - //Czechia represents 'Czechia' country + // Czechia represents 'Czechia' country Czechia = Country{ - name: NameCzechia, - alpha2: Alpha2CZ, - alpha3: Alpha3CZE, + name: "Czechia", + alpha2: "CZ", + alpha3: "CZE", } - //CoteDIvoire represents 'Côte d'Ivoire' country + // CoteDIvoire represents 'Côte d'Ivoire' country CoteDIvoire = Country{ - name: NameCoteDIvoire, - alpha2: Alpha2CI, - alpha3: Alpha3CIV, + name: "Côte d'Ivoire", + alpha2: "CI", + alpha3: "CIV", } - //Denmark represents 'Denmark' country + // Denmark represents 'Denmark' country Denmark = Country{ - name: NameDenmark, - alpha2: Alpha2DK, - alpha3: Alpha3DNK, + name: "Denmark", + alpha2: "DK", + alpha3: "DNK", } - //Djibouti represents 'Djibouti' country + // Djibouti represents 'Djibouti' country Djibouti = Country{ - name: NameDjibouti, - alpha2: Alpha2DJ, - alpha3: Alpha3DJI, + name: "Djibouti", + alpha2: "DJ", + alpha3: "DJI", } - //Dominica represents 'Dominica' country + // Dominica represents 'Dominica' country Dominica = Country{ - name: NameDominica, - alpha2: Alpha2DM, - alpha3: Alpha3DMA, + name: "Dominica", + alpha2: "DM", + alpha3: "DMA", } - //DominicanRepublic represents 'Dominican Republic (the)' country + // DominicanRepublic represents 'Dominican Republic (the)' country DominicanRepublic = Country{ - name: NameDominicanRepublic, - alpha2: Alpha2DO, - alpha3: Alpha3DOM, + name: "Dominican Republic (the)", + alpha2: "DO", + alpha3: "DOM", } - //Ecuador represents 'Ecuador' country + // Ecuador represents 'Ecuador' country Ecuador = Country{ - name: NameEcuador, - alpha2: Alpha2EC, - alpha3: Alpha3ECU, + name: "Ecuador", + alpha2: "EC", + alpha3: "ECU", } - //Egypt represents 'Egypt' country + // Egypt represents 'Egypt' country Egypt = Country{ - name: NameEgypt, - alpha2: Alpha2EG, - alpha3: Alpha3EGY, + name: "Egypt", + alpha2: "EG", + alpha3: "EGY", } - //ElSalvador represents 'El Salvador' country + // ElSalvador represents 'El Salvador' country ElSalvador = Country{ - name: NameElSalvador, - alpha2: Alpha2SV, - alpha3: Alpha3SLV, + name: "El Salvador", + alpha2: "SV", + alpha3: "SLV", } - //EquatorialGuinea represents 'Equatorial Guinea' country + // EquatorialGuinea represents 'Equatorial Guinea' country EquatorialGuinea = Country{ - name: NameEquatorialGuinea, - alpha2: Alpha2GQ, - alpha3: Alpha3GNQ, + name: "Equatorial Guinea", + alpha2: "GQ", + alpha3: "GNQ", } - //Eritrea represents 'Eritrea' country + // Eritrea represents 'Eritrea' country Eritrea = Country{ - name: NameEritrea, - alpha2: Alpha2ER, - alpha3: Alpha3ERI, + name: "Eritrea", + alpha2: "ER", + alpha3: "ERI", } - //Estonia represents 'Estonia' country + // Estonia represents 'Estonia' country Estonia = Country{ - name: NameEstonia, - alpha2: Alpha2EE, - alpha3: Alpha3EST, + name: "Estonia", + alpha2: "EE", + alpha3: "EST", } - //Eswatini represents 'Eswatini' country + // Eswatini represents 'Eswatini' country Eswatini = Country{ - name: NameEswatini, - alpha2: Alpha2SZ, - alpha3: Alpha3SWZ, + name: "Eswatini", + alpha2: "SZ", + alpha3: "SWZ", } - //Ethiopia represents 'Ethiopia' country + // Ethiopia represents 'Ethiopia' country Ethiopia = Country{ - name: NameEthiopia, - alpha2: Alpha2ET, - alpha3: Alpha3ETH, + name: "Ethiopia", + alpha2: "ET", + alpha3: "ETH", } - //FalklandIslands represents 'Falkland Islands (the) [Malvinas]' country + // FalklandIslands represents 'Falkland Islands (the) [Malvinas]' country FalklandIslands = Country{ - name: NameFalklandIslands, - alpha2: Alpha2FK, - alpha3: Alpha3FLK, + name: "Falkland Islands (the) [Malvinas]", + alpha2: "FK", + alpha3: "FLK", } - //FaroeIslands represents 'Faroe Islands (the)' country + // FaroeIslands represents 'Faroe Islands (the)' country FaroeIslands = Country{ - name: NameFaroeIslands, - alpha2: Alpha2FO, - alpha3: Alpha3FRO, + name: "Faroe Islands (the)", + alpha2: "FO", + alpha3: "FRO", } - //Fiji represents 'Fiji' country + // Fiji represents 'Fiji' country Fiji = Country{ - name: NameFiji, - alpha2: Alpha2FJ, - alpha3: Alpha3FJI, + name: "Fiji", + alpha2: "FJ", + alpha3: "FJI", } - //Finland represents 'Finland' country + // Finland represents 'Finland' country Finland = Country{ - name: NameFinland, - alpha2: Alpha2FI, - alpha3: Alpha3FIN, + name: "Finland", + alpha2: "FI", + alpha3: "FIN", } - //France represents 'France' country + // France represents 'France' country France = Country{ - name: NameFrance, - alpha2: Alpha2FR, - alpha3: Alpha3FRA, + name: "France", + alpha2: "FR", + alpha3: "FRA", } - //FrenchGuiana represents 'French Guiana' country + // FrenchGuiana represents 'French Guiana' country FrenchGuiana = Country{ - name: NameFrenchGuiana, - alpha2: Alpha2GF, - alpha3: Alpha3GUF, + name: "French Guiana", + alpha2: "GF", + alpha3: "GUF", } - //FrenchPolynesia represents 'French Polynesia' country + // FrenchPolynesia represents 'French Polynesia' country FrenchPolynesia = Country{ - name: NameFrenchPolynesia, - alpha2: Alpha2PF, - alpha3: Alpha3PYF, + name: "French Polynesia", + alpha2: "PF", + alpha3: "PYF", } - //FrenchSouthernTerritories represents 'French Southern Territories (the)' country + // FrenchSouthernTerritories represents 'French Southern Territories (the)' country FrenchSouthernTerritories = Country{ - name: NameFrenchSouthernTerritories, - alpha2: Alpha2TF, - alpha3: Alpha3ATF, + name: "French Southern Territories (the)", + alpha2: "TF", + alpha3: "ATF", } - //Gabon represents 'Gabon' country + // Gabon represents 'Gabon' country Gabon = Country{ - name: NameGabon, - alpha2: Alpha2GA, - alpha3: Alpha3GAB, + name: "Gabon", + alpha2: "GA", + alpha3: "GAB", } - //Gambia represents 'Gambia (the)' country + // Gambia represents 'Gambia (the)' country Gambia = Country{ - name: NameGambia, - alpha2: Alpha2GM, - alpha3: Alpha3GMB, + name: "Gambia (the)", + alpha2: "GM", + alpha3: "GMB", } - //Georgia represents 'Georgia' country + // Georgia represents 'Georgia' country Georgia = Country{ - name: NameGeorgia, - alpha2: Alpha2GE, - alpha3: Alpha3GEO, + name: "Georgia", + alpha2: "GE", + alpha3: "GEO", } - //Germany represents 'Germany' country + // Germany represents 'Germany' country Germany = Country{ - name: NameGermany, - alpha2: Alpha2DE, - alpha3: Alpha3DEU, + name: "Germany", + alpha2: "DE", + alpha3: "DEU", } - //Ghana represents 'Ghana' country + // Ghana represents 'Ghana' country Ghana = Country{ - name: NameGhana, - alpha2: Alpha2GH, - alpha3: Alpha3GHA, + name: "Ghana", + alpha2: "GH", + alpha3: "GHA", } - //Gibraltar represents 'Gibraltar' country + // Gibraltar represents 'Gibraltar' country Gibraltar = Country{ - name: NameGibraltar, - alpha2: Alpha2GI, - alpha3: Alpha3GIB, + name: "Gibraltar", + alpha2: "GI", + alpha3: "GIB", } - //Greece represents 'Greece' country + // Greece represents 'Greece' country Greece = Country{ - name: NameGreece, - alpha2: Alpha2GR, - alpha3: Alpha3GRC, + name: "Greece", + alpha2: "GR", + alpha3: "GRC", } - //Greenland represents 'Greenland' country + // Greenland represents 'Greenland' country Greenland = Country{ - name: NameGreenland, - alpha2: Alpha2GL, - alpha3: Alpha3GRL, + name: "Greenland", + alpha2: "GL", + alpha3: "GRL", } - //Grenada represents 'Grenada' country + // Grenada represents 'Grenada' country Grenada = Country{ - name: NameGrenada, - alpha2: Alpha2GD, - alpha3: Alpha3GRD, + name: "Grenada", + alpha2: "GD", + alpha3: "GRD", } - //Guadeloupe represents 'Guadeloupe' country + // Guadeloupe represents 'Guadeloupe' country Guadeloupe = Country{ - name: NameGuadeloupe, - alpha2: Alpha2GP, - alpha3: Alpha3GLP, + name: "Guadeloupe", + alpha2: "GP", + alpha3: "GLP", } - //Guam represents 'Guam' country + // Guam represents 'Guam' country Guam = Country{ - name: NameGuam, - alpha2: Alpha2GU, - alpha3: Alpha3GUM, + name: "Guam", + alpha2: "GU", + alpha3: "GUM", } - //Guatemala represents 'Guatemala' country + // Guatemala represents 'Guatemala' country Guatemala = Country{ - name: NameGuatemala, - alpha2: Alpha2GT, - alpha3: Alpha3GTM, + name: "Guatemala", + alpha2: "GT", + alpha3: "GTM", } - //Guernsey represents 'Guernsey' country + // Guernsey represents 'Guernsey' country Guernsey = Country{ - name: NameGuernsey, - alpha2: Alpha2GG, - alpha3: Alpha3GGY, + name: "Guernsey", + alpha2: "GG", + alpha3: "GGY", } - //Guinea represents 'Guinea' country + // Guinea represents 'Guinea' country Guinea = Country{ - name: NameGuinea, - alpha2: Alpha2GN, - alpha3: Alpha3GIN, + name: "Guinea", + alpha2: "GN", + alpha3: "GIN", } - //GuineaBissau represents 'Guinea-Bissau' country + // GuineaBissau represents 'Guinea-Bissau' country GuineaBissau = Country{ - name: NameGuineaBissau, - alpha2: Alpha2GW, - alpha3: Alpha3GNB, + name: "Guinea-Bissau", + alpha2: "GW", + alpha3: "GNB", } - //Guyana represents 'Guyana' country + // Guyana represents 'Guyana' country Guyana = Country{ - name: NameGuyana, - alpha2: Alpha2GY, - alpha3: Alpha3GUY, + name: "Guyana", + alpha2: "GY", + alpha3: "GUY", } - //Haiti represents 'Haiti' country + // Haiti represents 'Haiti' country Haiti = Country{ - name: NameHaiti, - alpha2: Alpha2HT, - alpha3: Alpha3HTI, + name: "Haiti", + alpha2: "HT", + alpha3: "HTI", } - //HeardIslandAndMcDonaldIslands represents 'Heard Island and McDonald Islands' country + // HeardIslandAndMcDonaldIslands represents 'Heard Island and McDonald Islands' country HeardIslandAndMcDonaldIslands = Country{ - name: NameHeardIslandAndMcDonaldIslands, - alpha2: Alpha2HM, - alpha3: Alpha3HMD, + name: "Heard Island and McDonald Islands", + alpha2: "HM", + alpha3: "HMD", } - //HolySee represents 'Holy See (the)' country + // HolySee represents 'Holy See (the)' country HolySee = Country{ - name: NameHolySee, - alpha2: Alpha2VA, - alpha3: Alpha3VAT, + name: "Holy See (the)", + alpha2: "VA", + alpha3: "VAT", } - //Honduras represents 'Honduras' country + // Honduras represents 'Honduras' country Honduras = Country{ - name: NameHonduras, - alpha2: Alpha2HN, - alpha3: Alpha3HND, + name: "Honduras", + alpha2: "HN", + alpha3: "HND", } - //HongKong represents 'Hong Kong' country + // HongKong represents 'Hong Kong' country HongKong = Country{ - name: NameHongKong, - alpha2: Alpha2HK, - alpha3: Alpha3HKG, + name: "Hong Kong", + alpha2: "HK", + alpha3: "HKG", } - //Hungary represents 'Hungary' country + // Hungary represents 'Hungary' country Hungary = Country{ - name: NameHungary, - alpha2: Alpha2HU, - alpha3: Alpha3HUN, + name: "Hungary", + alpha2: "HU", + alpha3: "HUN", } - //Iceland represents 'Iceland' country + // Iceland represents 'Iceland' country Iceland = Country{ - name: NameIceland, - alpha2: Alpha2IS, - alpha3: Alpha3ISL, + name: "Iceland", + alpha2: "IS", + alpha3: "ISL", } - //India represents 'India' country + // India represents 'India' country India = Country{ - name: NameIndia, - alpha2: Alpha2IN, - alpha3: Alpha3IND, + name: "India", + alpha2: "IN", + alpha3: "IND", } - //Indonesia represents 'Indonesia' country + // Indonesia represents 'Indonesia' country Indonesia = Country{ - name: NameIndonesia, - alpha2: Alpha2ID, - alpha3: Alpha3IDN, + name: "Indonesia", + alpha2: "ID", + alpha3: "IDN", } - //Iran represents 'Iran (Islamic Republic of)' country + // Iran represents 'Iran (Islamic Republic of)' country Iran = Country{ - name: NameIran, - alpha2: Alpha2IR, - alpha3: Alpha3IRN, + name: "Iran (Islamic Republic of)", + alpha2: "IR", + alpha3: "IRN", } - //Iraq represents 'Iraq' country + // Iraq represents 'Iraq' country Iraq = Country{ - name: NameIraq, - alpha2: Alpha2IQ, - alpha3: Alpha3IRQ, + name: "Iraq", + alpha2: "IQ", + alpha3: "IRQ", } - //Ireland represents 'Ireland' country + // Ireland represents 'Ireland' country Ireland = Country{ - name: NameIreland, - alpha2: Alpha2IE, - alpha3: Alpha3IRL, + name: "Ireland", + alpha2: "IE", + alpha3: "IRL", } - //IsleOfMan represents 'Isle of Man' country + // IsleOfMan represents 'Isle of Man' country IsleOfMan = Country{ - name: NameIsleOfMan, - alpha2: Alpha2IM, - alpha3: Alpha3IMN, + name: "Isle of Man", + alpha2: "IM", + alpha3: "IMN", } - //Israel represents 'Israel' country + // Israel represents 'Israel' country Israel = Country{ - name: NameIsrael, - alpha2: Alpha2IL, - alpha3: Alpha3ISR, + name: "Israel", + alpha2: "IL", + alpha3: "ISR", } - //Italy represents 'Italy' country + // Italy represents 'Italy' country Italy = Country{ - name: NameItaly, - alpha2: Alpha2IT, - alpha3: Alpha3ITA, + name: "Italy", + alpha2: "IT", + alpha3: "ITA", } - //Jamaica represents 'Jamaica' country + // Jamaica represents 'Jamaica' country Jamaica = Country{ - name: NameJamaica, - alpha2: Alpha2JM, - alpha3: Alpha3JAM, + name: "Jamaica", + alpha2: "JM", + alpha3: "JAM", } - //Japan represents 'Japan' country + // Japan represents 'Japan' country Japan = Country{ - name: NameJapan, - alpha2: Alpha2JP, - alpha3: Alpha3JPN, + name: "Japan", + alpha2: "JP", + alpha3: "JPN", } - //Jersey represents 'Jersey' country + // Jersey represents 'Jersey' country Jersey = Country{ - name: NameJersey, - alpha2: Alpha2JE, - alpha3: Alpha3JEY, + name: "Jersey", + alpha2: "JE", + alpha3: "JEY", } - //Jordan represents 'Jordan' country + // Jordan represents 'Jordan' country Jordan = Country{ - name: NameJordan, - alpha2: Alpha2JO, - alpha3: Alpha3JOR, + name: "Jordan", + alpha2: "JO", + alpha3: "JOR", } - //Kazakhstan represents 'Kazakhstan' country + // Kazakhstan represents 'Kazakhstan' country Kazakhstan = Country{ - name: NameKazakhstan, - alpha2: Alpha2KZ, - alpha3: Alpha3KAZ, + name: "Kazakhstan", + alpha2: "KZ", + alpha3: "KAZ", } - //Kenya represents 'Kenya' country + // Kenya represents 'Kenya' country Kenya = Country{ - name: NameKenya, - alpha2: Alpha2KE, - alpha3: Alpha3KEN, + name: "Kenya", + alpha2: "KE", + alpha3: "KEN", } - //Kiribati represents 'Kiribati' country + // Kiribati represents 'Kiribati' country Kiribati = Country{ - name: NameKiribati, - alpha2: Alpha2KI, - alpha3: Alpha3KIR, + name: "Kiribati", + alpha2: "KI", + alpha3: "KIR", } - //NorthKorea represents 'Korea (the Democratic People's Republic of)' country + // NorthKorea represents 'Korea (the Democratic People's Republic of)' country NorthKorea = Country{ - name: NameNorthKorea, - alpha2: Alpha2KP, - alpha3: Alpha3PRK, + name: "Korea (the Democratic People's Republic of)", + alpha2: "KP", + alpha3: "PRK", } - //SouthKorea represents 'Korea (the Republic of)' country + // SouthKorea represents 'Korea (the Republic of)' country SouthKorea = Country{ - name: NameSouthKorea, - alpha2: Alpha2KR, - alpha3: Alpha3KOR, + name: "Korea (the Republic of)", + alpha2: "KR", + alpha3: "KOR", } - //Kuwait represents 'Kuwait' country + // Kuwait represents 'Kuwait' country Kuwait = Country{ - name: NameKuwait, - alpha2: Alpha2KW, - alpha3: Alpha3KWT, + name: "Kuwait", + alpha2: "KW", + alpha3: "KWT", } - //Kyrgyzstan represents 'Kyrgyzstan' country + // Kyrgyzstan represents 'Kyrgyzstan' country Kyrgyzstan = Country{ - name: NameKyrgyzstan, - alpha2: Alpha2KG, - alpha3: Alpha3KGZ, + name: "Kyrgyzstan", + alpha2: "KG", + alpha3: "KGZ", } - //LaoPeoplesDemocraticRepublic represents 'Lao People's Democratic Republic (the)' country + // LaoPeoplesDemocraticRepublic represents 'Lao People's Democratic Republic (the)' country LaoPeoplesDemocraticRepublic = Country{ - name: NameLaoPeoplesDemocraticRepublic, - alpha2: Alpha2LA, - alpha3: Alpha3LAO, + name: "Lao People's Democratic Republic (the)", + alpha2: "LA", + alpha3: "LAO", } - //Latvia represents 'Latvia' country + // Latvia represents 'Latvia' country Latvia = Country{ - name: NameLatvia, - alpha2: Alpha2LV, - alpha3: Alpha3LVA, + name: "Latvia", + alpha2: "LV", + alpha3: "LVA", } - //Lebanon represents 'Lebanon' country + // Lebanon represents 'Lebanon' country Lebanon = Country{ - name: NameLebanon, - alpha2: Alpha2LB, - alpha3: Alpha3LBN, + name: "Lebanon", + alpha2: "LB", + alpha3: "LBN", } - //Lesotho represents 'Lesotho' country + // Lesotho represents 'Lesotho' country Lesotho = Country{ - name: NameLesotho, - alpha2: Alpha2LS, - alpha3: Alpha3LSO, + name: "Lesotho", + alpha2: "LS", + alpha3: "LSO", } - //Liberia represents 'Liberia' country + // Liberia represents 'Liberia' country Liberia = Country{ - name: NameLiberia, - alpha2: Alpha2LR, - alpha3: Alpha3LBR, + name: "Liberia", + alpha2: "LR", + alpha3: "LBR", } - //Libya represents 'Libya' country + // Libya represents 'Libya' country Libya = Country{ - name: NameLibya, - alpha2: Alpha2LY, - alpha3: Alpha3LBY, + name: "Libya", + alpha2: "LY", + alpha3: "LBY", } - //Liechtenstein represents 'Liechtenstein' country + // Liechtenstein represents 'Liechtenstein' country Liechtenstein = Country{ - name: NameLiechtenstein, - alpha2: Alpha2LI, - alpha3: Alpha3LIE, + name: "Liechtenstein", + alpha2: "LI", + alpha3: "LIE", } - //Lithuania represents 'Lithuania' country + // Lithuania represents 'Lithuania' country Lithuania = Country{ - name: NameLithuania, - alpha2: Alpha2LT, - alpha3: Alpha3LTU, + name: "Lithuania", + alpha2: "LT", + alpha3: "LTU", } - //Luxembourg represents 'Luxembourg' country + // Luxembourg represents 'Luxembourg' country Luxembourg = Country{ - name: NameLuxembourg, - alpha2: Alpha2LU, - alpha3: Alpha3LUX, + name: "Luxembourg", + alpha2: "LU", + alpha3: "LUX", } - //Macao represents 'Macao' country + // Macao represents 'Macao' country Macao = Country{ - name: NameMacao, - alpha2: Alpha2MO, - alpha3: Alpha3MAC, + name: "Macao", + alpha2: "MO", + alpha3: "MAC", } - //Madagascar represents 'Madagascar' country + // Madagascar represents 'Madagascar' country Madagascar = Country{ - name: NameMadagascar, - alpha2: Alpha2MG, - alpha3: Alpha3MDG, + name: "Madagascar", + alpha2: "MG", + alpha3: "MDG", } - //Malawi represents 'Malawi' country + // Malawi represents 'Malawi' country Malawi = Country{ - name: NameMalawi, - alpha2: Alpha2MW, - alpha3: Alpha3MWI, + name: "Malawi", + alpha2: "MW", + alpha3: "MWI", } - //Malaysia represents 'Malaysia' country + // Malaysia represents 'Malaysia' country Malaysia = Country{ - name: NameMalaysia, - alpha2: Alpha2MY, - alpha3: Alpha3MYS, + name: "Malaysia", + alpha2: "MY", + alpha3: "MYS", } - //Maldives represents 'Maldives' country + // Maldives represents 'Maldives' country Maldives = Country{ - name: NameMaldives, - alpha2: Alpha2MV, - alpha3: Alpha3MDV, + name: "Maldives", + alpha2: "MV", + alpha3: "MDV", } - //Mali represents 'Mali' country + // Mali represents 'Mali' country Mali = Country{ - name: NameMali, - alpha2: Alpha2ML, - alpha3: Alpha3MLI, + name: "Mali", + alpha2: "ML", + alpha3: "MLI", } - //Malta represents 'Malta' country + // Malta represents 'Malta' country Malta = Country{ - name: NameMalta, - alpha2: Alpha2MT, - alpha3: Alpha3MLT, + name: "Malta", + alpha2: "MT", + alpha3: "MLT", } - //MarshallIslands represents 'Marshall Islands (the)' country + // MarshallIslands represents 'Marshall Islands (the)' country MarshallIslands = Country{ - name: NameMarshallIslands, - alpha2: Alpha2MH, - alpha3: Alpha3MHL, + name: "Marshall Islands (the)", + alpha2: "MH", + alpha3: "MHL", } - //Martinique represents 'Martinique' country + // Martinique represents 'Martinique' country Martinique = Country{ - name: NameMartinique, - alpha2: Alpha2MQ, - alpha3: Alpha3MTQ, + name: "Martinique", + alpha2: "MQ", + alpha3: "MTQ", } - //Mauritania represents 'Mauritania' country + // Mauritania represents 'Mauritania' country Mauritania = Country{ - name: NameMauritania, - alpha2: Alpha2MR, - alpha3: Alpha3MRT, + name: "Mauritania", + alpha2: "MR", + alpha3: "MRT", } - //Mauritius represents 'Mauritius' country + // Mauritius represents 'Mauritius' country Mauritius = Country{ - name: NameMauritius, - alpha2: Alpha2MU, - alpha3: Alpha3MUS, + name: "Mauritius", + alpha2: "MU", + alpha3: "MUS", } - //Mayotte represents 'Mayotte' country + // Mayotte represents 'Mayotte' country Mayotte = Country{ - name: NameMayotte, - alpha2: Alpha2YT, - alpha3: Alpha3MYT, + name: "Mayotte", + alpha2: "YT", + alpha3: "MYT", } - //Mexico represents 'Mexico' country + // Mexico represents 'Mexico' country Mexico = Country{ - name: NameMexico, - alpha2: Alpha2MX, - alpha3: Alpha3MEX, + name: "Mexico", + alpha2: "MX", + alpha3: "MEX", } - //Micronesia represents 'Micronesia (Federated States of)' country + // Micronesia represents 'Micronesia (Federated States of)' country Micronesia = Country{ - name: NameMicronesia, - alpha2: Alpha2FM, - alpha3: Alpha3FSM, + name: "Micronesia (Federated States of)", + alpha2: "FM", + alpha3: "FSM", } - //Moldova represents 'Moldova (the Republic of)' country + // Moldova represents 'Moldova (the Republic of)' country Moldova = Country{ - name: NameMoldova, - alpha2: Alpha2MD, - alpha3: Alpha3MDA, + name: "Moldova (the Republic of)", + alpha2: "MD", + alpha3: "MDA", } - //Monaco represents 'Monaco' country + // Monaco represents 'Monaco' country Monaco = Country{ - name: NameMonaco, - alpha2: Alpha2MC, - alpha3: Alpha3MCO, + name: "Monaco", + alpha2: "MC", + alpha3: "MCO", } - //Mongolia represents 'Mongolia' country + // Mongolia represents 'Mongolia' country Mongolia = Country{ - name: NameMongolia, - alpha2: Alpha2MN, - alpha3: Alpha3MNG, + name: "Mongolia", + alpha2: "MN", + alpha3: "MNG", } - //Montenegro represents 'Montenegro' country + // Montenegro represents 'Montenegro' country Montenegro = Country{ - name: NameMontenegro, - alpha2: Alpha2ME, - alpha3: Alpha3MNE, + name: "Montenegro", + alpha2: "ME", + alpha3: "MNE", } - //Montserrat represents 'Montserrat' country + // Montserrat represents 'Montserrat' country Montserrat = Country{ - name: NameMontserrat, - alpha2: Alpha2MS, - alpha3: Alpha3MSR, + name: "Montserrat", + alpha2: "MS", + alpha3: "MSR", } - //Morocco represents 'Morocco' country + // Morocco represents 'Morocco' country Morocco = Country{ - name: NameMorocco, - alpha2: Alpha2MA, - alpha3: Alpha3MAR, + name: "Morocco", + alpha2: "MA", + alpha3: "MAR", } - //Mozambique represents 'Mozambique' country + // Mozambique represents 'Mozambique' country Mozambique = Country{ - name: NameMozambique, - alpha2: Alpha2MZ, - alpha3: Alpha3MOZ, + name: "Mozambique", + alpha2: "MZ", + alpha3: "MOZ", } - //Myanmar represents 'Myanmar' country + // Myanmar represents 'Myanmar' country Myanmar = Country{ - name: NameMyanmar, - alpha2: Alpha2MM, - alpha3: Alpha3MMR, + name: "Myanmar", + alpha2: "MM", + alpha3: "MMR", } - //Namibia represents 'Namibia' country + // Namibia represents 'Namibia' country Namibia = Country{ - name: NameNamibia, - alpha2: Alpha2NA, - alpha3: Alpha3NAM, + name: "Namibia", + alpha2: "NA", + alpha3: "NAM", } - //Nauru represents 'Nauru' country + // Nauru represents 'Nauru' country Nauru = Country{ - name: NameNauru, - alpha2: Alpha2NR, - alpha3: Alpha3NRU, + name: "Nauru", + alpha2: "NR", + alpha3: "NRU", } - //Nepal represents 'Nepal' country + // Nepal represents 'Nepal' country Nepal = Country{ - name: NameNepal, - alpha2: Alpha2NP, - alpha3: Alpha3NPL, + name: "Nepal", + alpha2: "NP", + alpha3: "NPL", } - //Netherlands represents 'Netherlands (the)' country + // Netherlands represents 'Netherlands (the)' country Netherlands = Country{ - name: NameNetherlands, - alpha2: Alpha2NL, - alpha3: Alpha3NLD, + name: "Netherlands (the)", + alpha2: "NL", + alpha3: "NLD", } - //NewCaledonia represents 'New Caledonia' country + // NewCaledonia represents 'New Caledonia' country NewCaledonia = Country{ - name: NameNewCaledonia, - alpha2: Alpha2NC, - alpha3: Alpha3NCL, + name: "New Caledonia", + alpha2: "NC", + alpha3: "NCL", } - //NewZealand represents 'New Zealand' country + // NewZealand represents 'New Zealand' country NewZealand = Country{ - name: NameNewZealand, - alpha2: Alpha2NZ, - alpha3: Alpha3NZL, + name: "New Zealand", + alpha2: "NZ", + alpha3: "NZL", } - //Nicaragua represents 'Nicaragua' country + // Nicaragua represents 'Nicaragua' country Nicaragua = Country{ - name: NameNicaragua, - alpha2: Alpha2NI, - alpha3: Alpha3NIC, + name: "Nicaragua", + alpha2: "NI", + alpha3: "NIC", } - //Niger represents 'Niger (the)' country + // Niger represents 'Niger (the)' country Niger = Country{ - name: NameNiger, - alpha2: Alpha2NE, - alpha3: Alpha3NER, + name: "Niger (the)", + alpha2: "NE", + alpha3: "NER", } - //Nigeria represents 'Nigeria' country + // Nigeria represents 'Nigeria' country Nigeria = Country{ - name: NameNigeria, - alpha2: Alpha2NG, - alpha3: Alpha3NGA, + name: "Nigeria", + alpha2: "NG", + alpha3: "NGA", } - //Niue represents 'Niue' country + // Niue represents 'Niue' country Niue = Country{ - name: NameNiue, - alpha2: Alpha2NU, - alpha3: Alpha3NIU, + name: "Niue", + alpha2: "NU", + alpha3: "NIU", } - //NorfolkIsland represents 'Norfolk Island' country + // NorfolkIsland represents 'Norfolk Island' country NorfolkIsland = Country{ - name: NameNorfolkIsland, - alpha2: Alpha2NF, - alpha3: Alpha3NFK, + name: "Norfolk Island", + alpha2: "NF", + alpha3: "NFK", } - //NorthMacedonia represents 'North Macedonia' country + // NorthMacedonia represents 'North Macedonia' country NorthMacedonia = Country{ - name: NameNorthMacedonia, - alpha2: Alpha2MK, - alpha3: Alpha3MKD, + name: "North Macedonia", + alpha2: "MK", + alpha3: "MKD", } - //NorthernMarianaIslands represents 'Northern Mariana Islands (the)' country + // NorthernMarianaIslands represents 'Northern Mariana Islands (the)' country NorthernMarianaIslands = Country{ - name: NameNorthernMarianaIslands, - alpha2: Alpha2MP, - alpha3: Alpha3MNP, + name: "Northern Mariana Islands (the)", + alpha2: "MP", + alpha3: "MNP", } - //Norway represents 'Norway' country + // Norway represents 'Norway' country Norway = Country{ - name: NameNorway, - alpha2: Alpha2NO, - alpha3: Alpha3NOR, + name: "Norway", + alpha2: "NO", + alpha3: "NOR", } - //Oman represents 'Oman' country + // Oman represents 'Oman' country Oman = Country{ - name: NameOman, - alpha2: Alpha2OM, - alpha3: Alpha3OMN, + name: "Oman", + alpha2: "OM", + alpha3: "OMN", } - //Pakistan represents 'Pakistan' country + // Pakistan represents 'Pakistan' country Pakistan = Country{ - name: NamePakistan, - alpha2: Alpha2PK, - alpha3: Alpha3PAK, + name: "Pakistan", + alpha2: "PK", + alpha3: "PAK", } - //Palau represents 'Palau' country + // Palau represents 'Palau' country Palau = Country{ - name: NamePalau, - alpha2: Alpha2PW, - alpha3: Alpha3PLW, + name: "Palau", + alpha2: "PW", + alpha3: "PLW", } - //Palestine represents 'Palestine, State of' country + // Palestine represents 'Palestine, State of' country Palestine = Country{ - name: NamePalestine, - alpha2: Alpha2PS, - alpha3: Alpha3PSE, + name: "Palestine, State of", + alpha2: "PS", + alpha3: "PSE", } - //Panama represents 'Panama' country + // Panama represents 'Panama' country Panama = Country{ - name: NamePanama, - alpha2: Alpha2PA, - alpha3: Alpha3PAN, + name: "Panama", + alpha2: "PA", + alpha3: "PAN", } - //PapuaNewGuinea represents 'Papua New Guinea' country + // PapuaNewGuinea represents 'Papua New Guinea' country PapuaNewGuinea = Country{ - name: NamePapuaNewGuinea, - alpha2: Alpha2PG, - alpha3: Alpha3PNG, + name: "Papua New Guinea", + alpha2: "PG", + alpha3: "PNG", } - //Paraguay represents 'Paraguay' country + // Paraguay represents 'Paraguay' country Paraguay = Country{ - name: NameParaguay, - alpha2: Alpha2PY, - alpha3: Alpha3PRY, + name: "Paraguay", + alpha2: "PY", + alpha3: "PRY", } - //Peru represents 'Peru' country + // Peru represents 'Peru' country Peru = Country{ - name: NamePeru, - alpha2: Alpha2PE, - alpha3: Alpha3PER, + name: "Peru", + alpha2: "PE", + alpha3: "PER", } - //Philippines represents 'Philippines (the)' country + // Philippines represents 'Philippines (the)' country Philippines = Country{ - name: NamePhilippines, - alpha2: Alpha2PH, - alpha3: Alpha3PHL, + name: "Philippines (the)", + alpha2: "PH", + alpha3: "PHL", } - //Pitcairn represents 'Pitcairn' country + // Pitcairn represents 'Pitcairn' country Pitcairn = Country{ - name: NamePitcairn, - alpha2: Alpha2PN, - alpha3: Alpha3PCN, + name: "Pitcairn", + alpha2: "PN", + alpha3: "PCN", } - //Poland represents 'Poland' country + // Poland represents 'Poland' country Poland = Country{ - name: NamePoland, - alpha2: Alpha2PL, - alpha3: Alpha3POL, + name: "Poland", + alpha2: "PL", + alpha3: "POL", } - //Portugal represents 'Portugal' country + // Portugal represents 'Portugal' country Portugal = Country{ - name: NamePortugal, - alpha2: Alpha2PT, - alpha3: Alpha3PRT, + name: "Portugal", + alpha2: "PT", + alpha3: "PRT", } - //PuertoRico represents 'Puerto Rico' country + // PuertoRico represents 'Puerto Rico' country PuertoRico = Country{ - name: NamePuertoRico, - alpha2: Alpha2PR, - alpha3: Alpha3PRI, + name: "Puerto Rico", + alpha2: "PR", + alpha3: "PRI", } - //Qatar represents 'Qatar' country + // Qatar represents 'Qatar' country Qatar = Country{ - name: NameQatar, - alpha2: Alpha2QA, - alpha3: Alpha3QAT, + name: "Qatar", + alpha2: "QA", + alpha3: "QAT", } - //Romania represents 'Romania' country + // Romania represents 'Romania' country Romania = Country{ - name: NameRomania, - alpha2: Alpha2RO, - alpha3: Alpha3ROU, + name: "Romania", + alpha2: "RO", + alpha3: "ROU", } - //RussianFederation represents 'Russian Federation (the)' country + // RussianFederation represents 'Russian Federation (the)' country RussianFederation = Country{ - name: NameRussianFederation, - alpha2: Alpha2RU, - alpha3: Alpha3RUS, + name: "Russian Federation (the)", + alpha2: "RU", + alpha3: "RUS", } - //Rwanda represents 'Rwanda' country + // Rwanda represents 'Rwanda' country Rwanda = Country{ - name: NameRwanda, - alpha2: Alpha2RW, - alpha3: Alpha3RWA, + name: "Rwanda", + alpha2: "RW", + alpha3: "RWA", } - //Reunion represents 'Réunion' country + // Reunion represents 'Réunion' country Reunion = Country{ - name: NameReunion, - alpha2: Alpha2RE, - alpha3: Alpha3REU, + name: "Réunion", + alpha2: "RE", + alpha3: "REU", } - //SaintBarthelemy represents 'Saint Barthélemy' country + // SaintBarthelemy represents 'Saint Barthélemy' country SaintBarthelemy = Country{ - name: NameSaintBarthelemy, - alpha2: Alpha2BL, - alpha3: Alpha3BLM, + name: "Saint Barthélemy", + alpha2: "BL", + alpha3: "BLM", } - //SaintHelenaAscensionAndTristanDaCunha represents 'Saint Helena, Ascension and Tristan da Cunha' country + // SaintHelenaAscensionAndTristanDaCunha represents 'Saint Helena, Ascension and Tristan da Cunha' country SaintHelenaAscensionAndTristanDaCunha = Country{ - name: NameSaintHelenaAscensionAndTristanDaCunha, - alpha2: Alpha2SH, - alpha3: Alpha3SHN, + name: "Saint Helena, Ascension and Tristan da Cunha", + alpha2: "SH", + alpha3: "SHN", } - //SaintKittsAndNevis represents 'Saint Kitts and Nevis' country + // SaintKittsAndNevis represents 'Saint Kitts and Nevis' country SaintKittsAndNevis = Country{ - name: NameSaintKittsAndNevis, - alpha2: Alpha2KN, - alpha3: Alpha3KNA, + name: "Saint Kitts and Nevis", + alpha2: "KN", + alpha3: "KNA", } - //SaintLucia represents 'Saint Lucia' country + // SaintLucia represents 'Saint Lucia' country SaintLucia = Country{ - name: NameSaintLucia, - alpha2: Alpha2LC, - alpha3: Alpha3LCA, + name: "Saint Lucia", + alpha2: "LC", + alpha3: "LCA", } - //SaintMartin represents 'Saint Martin (French part)' country + // SaintMartin represents 'Saint Martin (French part)' country SaintMartin = Country{ - name: NameSaintMartin, - alpha2: Alpha2MF, - alpha3: Alpha3MAF, + name: "Saint Martin (French part)", + alpha2: "MF", + alpha3: "MAF", } - //SaintPierreAndMiquelon represents 'Saint Pierre and Miquelon' country + // SaintPierreAndMiquelon represents 'Saint Pierre and Miquelon' country SaintPierreAndMiquelon = Country{ - name: NameSaintPierreAndMiquelon, - alpha2: Alpha2PM, - alpha3: Alpha3SPM, + name: "Saint Pierre and Miquelon", + alpha2: "PM", + alpha3: "SPM", } - //SaintVincentAndTheGrenadines represents 'Saint Vincent and the Grenadines' country + // SaintVincentAndTheGrenadines represents 'Saint Vincent and the Grenadines' country SaintVincentAndTheGrenadines = Country{ - name: NameSaintVincentAndTheGrenadines, - alpha2: Alpha2VC, - alpha3: Alpha3VCT, + name: "Saint Vincent and the Grenadines", + alpha2: "VC", + alpha3: "VCT", } - //Samoa represents 'Samoa' country + // Samoa represents 'Samoa' country Samoa = Country{ - name: NameSamoa, - alpha2: Alpha2WS, - alpha3: Alpha3WSM, + name: "Samoa", + alpha2: "WS", + alpha3: "WSM", } - //SanMarino represents 'San Marino' country + // SanMarino represents 'San Marino' country SanMarino = Country{ - name: NameSanMarino, - alpha2: Alpha2SM, - alpha3: Alpha3SMR, + name: "San Marino", + alpha2: "SM", + alpha3: "SMR", } - //SaoTomeAndPrincipe represents 'Sao Tome and Principe' country + // SaoTomeAndPrincipe represents 'Sao Tome and Principe' country SaoTomeAndPrincipe = Country{ - name: NameSaoTomeAndPrincipe, - alpha2: Alpha2ST, - alpha3: Alpha3STP, + name: "Sao Tome and Principe", + alpha2: "ST", + alpha3: "STP", } - //SaudiArabia represents 'Saudi Arabia' country + // SaudiArabia represents 'Saudi Arabia' country SaudiArabia = Country{ - name: NameSaudiArabia, - alpha2: Alpha2SA, - alpha3: Alpha3SAU, + name: "Saudi Arabia", + alpha2: "SA", + alpha3: "SAU", } - //Senegal represents 'Senegal' country + // Senegal represents 'Senegal' country Senegal = Country{ - name: NameSenegal, - alpha2: Alpha2SN, - alpha3: Alpha3SEN, + name: "Senegal", + alpha2: "SN", + alpha3: "SEN", } - //Serbia represents 'Serbia' country + // Serbia represents 'Serbia' country Serbia = Country{ - name: NameSerbia, - alpha2: Alpha2RS, - alpha3: Alpha3SRB, + name: "Serbia", + alpha2: "RS", + alpha3: "SRB", } - //Seychelles represents 'Seychelles' country + // Seychelles represents 'Seychelles' country Seychelles = Country{ - name: NameSeychelles, - alpha2: Alpha2SC, - alpha3: Alpha3SYC, + name: "Seychelles", + alpha2: "SC", + alpha3: "SYC", } - //SierraLeone represents 'Sierra Leone' country + // SierraLeone represents 'Sierra Leone' country SierraLeone = Country{ - name: NameSierraLeone, - alpha2: Alpha2SL, - alpha3: Alpha3SLE, + name: "Sierra Leone", + alpha2: "SL", + alpha3: "SLE", } - //Singapore represents 'Singapore' country + // Singapore represents 'Singapore' country Singapore = Country{ - name: NameSingapore, - alpha2: Alpha2SG, - alpha3: Alpha3SGP, + name: "Singapore", + alpha2: "SG", + alpha3: "SGP", } - //SintMaarten represents 'Sint Maarten (Dutch part)' country + // SintMaarten represents 'Sint Maarten (Dutch part)' country SintMaarten = Country{ - name: NameSintMaarten, - alpha2: Alpha2SX, - alpha3: Alpha3SXM, + name: "Sint Maarten (Dutch part)", + alpha2: "SX", + alpha3: "SXM", } - //Slovakia represents 'Slovakia' country + // Slovakia represents 'Slovakia' country Slovakia = Country{ - name: NameSlovakia, - alpha2: Alpha2SK, - alpha3: Alpha3SVK, + name: "Slovakia", + alpha2: "SK", + alpha3: "SVK", } - //Slovenia represents 'Slovenia' country + // Slovenia represents 'Slovenia' country Slovenia = Country{ - name: NameSlovenia, - alpha2: Alpha2SI, - alpha3: Alpha3SVN, + name: "Slovenia", + alpha2: "SI", + alpha3: "SVN", } - //SolomonIslands represents 'Solomon Islands' country + // SolomonIslands represents 'Solomon Islands' country SolomonIslands = Country{ - name: NameSolomonIslands, - alpha2: Alpha2SB, - alpha3: Alpha3SLB, + name: "Solomon Islands", + alpha2: "SB", + alpha3: "SLB", } - //Somalia represents 'Somalia' country + // Somalia represents 'Somalia' country Somalia = Country{ - name: NameSomalia, - alpha2: Alpha2SO, - alpha3: Alpha3SOM, + name: "Somalia", + alpha2: "SO", + alpha3: "SOM", } - //SouthAfrica represents 'South Africa' country + // SouthAfrica represents 'South Africa' country SouthAfrica = Country{ - name: NameSouthAfrica, - alpha2: Alpha2ZA, - alpha3: Alpha3ZAF, + name: "South Africa", + alpha2: "ZA", + alpha3: "ZAF", } - //SouthGeorgiaAndTheSouthSandwichIslands represents 'South Georgia and the South Sandwich Islands' country + // SouthGeorgiaAndTheSouthSandwichIslands represents 'South Georgia and the South Sandwich Islands' country SouthGeorgiaAndTheSouthSandwichIslands = Country{ - name: NameSouthGeorgiaAndTheSouthSandwichIslands, - alpha2: Alpha2GS, - alpha3: Alpha3SGS, + name: "South Georgia and the South Sandwich Islands", + alpha2: "GS", + alpha3: "SGS", } - //SouthSudan represents 'South Sudan' country + // SouthSudan represents 'South Sudan' country SouthSudan = Country{ - name: NameSouthSudan, - alpha2: Alpha2SS, - alpha3: Alpha3SSD, + name: "South Sudan", + alpha2: "SS", + alpha3: "SSD", } - //Spain represents 'Spain' country + // Spain represents 'Spain' country Spain = Country{ - name: NameSpain, - alpha2: Alpha2ES, - alpha3: Alpha3ESP, + name: "Spain", + alpha2: "ES", + alpha3: "ESP", } - //SriLanka represents 'Sri Lanka' country + // SriLanka represents 'Sri Lanka' country SriLanka = Country{ - name: NameSriLanka, - alpha2: Alpha2LK, - alpha3: Alpha3LKA, + name: "Sri Lanka", + alpha2: "LK", + alpha3: "LKA", } - //Sudan represents 'Sudan (the)' country + // Sudan represents 'Sudan (the)' country Sudan = Country{ - name: NameSudan, - alpha2: Alpha2SD, - alpha3: Alpha3SDN, + name: "Sudan (the)", + alpha2: "SD", + alpha3: "SDN", } - //Suriname represents 'Suriname' country + // Suriname represents 'Suriname' country Suriname = Country{ - name: NameSuriname, - alpha2: Alpha2SR, - alpha3: Alpha3SUR, + name: "Suriname", + alpha2: "SR", + alpha3: "SUR", } - //SvalbardAndJanMayen represents 'Svalbard and Jan Mayen' country + // SvalbardAndJanMayen represents 'Svalbard and Jan Mayen' country SvalbardAndJanMayen = Country{ - name: NameSvalbardAndJanMayen, - alpha2: Alpha2SJ, - alpha3: Alpha3SJM, + name: "Svalbard and Jan Mayen", + alpha2: "SJ", + alpha3: "SJM", } - //Sweden represents 'Sweden' country + // Sweden represents 'Sweden' country Sweden = Country{ - name: NameSweden, - alpha2: Alpha2SE, - alpha3: Alpha3SWE, + name: "Sweden", + alpha2: "SE", + alpha3: "SWE", } - //Switzerland represents 'Switzerland' country + // Switzerland represents 'Switzerland' country Switzerland = Country{ - name: NameSwitzerland, - alpha2: Alpha2CH, - alpha3: Alpha3CHE, + name: "Switzerland", + alpha2: "CH", + alpha3: "CHE", } - //SyrianArabRepublic represents 'Syrian Arab Republic (the)' country + // SyrianArabRepublic represents 'Syrian Arab Republic (the)' country SyrianArabRepublic = Country{ - name: NameSyrianArabRepublic, - alpha2: Alpha2SY, - alpha3: Alpha3SYR, + name: "Syrian Arab Republic (the)", + alpha2: "SY", + alpha3: "SYR", } - //Taiwan represents 'Taiwan (Province of China)' country + // Taiwan represents 'Taiwan (Province of China)' country Taiwan = Country{ - name: NameTaiwan, - alpha2: Alpha2TW, - alpha3: Alpha3TWN, + name: "Taiwan (Province of China)", + alpha2: "TW", + alpha3: "TWN", } - //Tajikistan represents 'Tajikistan' country + // Tajikistan represents 'Tajikistan' country Tajikistan = Country{ - name: NameTajikistan, - alpha2: Alpha2TJ, - alpha3: Alpha3TJK, + name: "Tajikistan", + alpha2: "TJ", + alpha3: "TJK", } - //TanzaniaTheUnitedRepublicOf represents 'Tanzania, the United Republic of' country + // TanzaniaTheUnitedRepublicOf represents 'Tanzania, the United Republic of' country TanzaniaTheUnitedRepublicOf = Country{ - name: NameTanzaniaTheUnitedRepublicOf, - alpha2: Alpha2TZ, - alpha3: Alpha3TZA, + name: "Tanzania, the United Republic of", + alpha2: "TZ", + alpha3: "TZA", } - //Thailand represents 'Thailand' country + // Thailand represents 'Thailand' country Thailand = Country{ - name: NameThailand, - alpha2: Alpha2TH, - alpha3: Alpha3THA, + name: "Thailand", + alpha2: "TH", + alpha3: "THA", } - //TimorLeste represents 'Timor-Leste' country + // TimorLeste represents 'Timor-Leste' country TimorLeste = Country{ - name: NameTimorLeste, - alpha2: Alpha2TL, - alpha3: Alpha3TLS, + name: "Timor-Leste", + alpha2: "TL", + alpha3: "TLS", } - //Togo represents 'Togo' country + // Togo represents 'Togo' country Togo = Country{ - name: NameTogo, - alpha2: Alpha2TG, - alpha3: Alpha3TGO, + name: "Togo", + alpha2: "TG", + alpha3: "TGO", } - //Tokelau represents 'Tokelau' country + // Tokelau represents 'Tokelau' country Tokelau = Country{ - name: NameTokelau, - alpha2: Alpha2TK, - alpha3: Alpha3TKL, + name: "Tokelau", + alpha2: "TK", + alpha3: "TKL", } - //Tonga represents 'Tonga' country + // Tonga represents 'Tonga' country Tonga = Country{ - name: NameTonga, - alpha2: Alpha2TO, - alpha3: Alpha3TON, + name: "Tonga", + alpha2: "TO", + alpha3: "TON", } - //TrinidadAndTobago represents 'Trinidad and Tobago' country + // TrinidadAndTobago represents 'Trinidad and Tobago' country TrinidadAndTobago = Country{ - name: NameTrinidadAndTobago, - alpha2: Alpha2TT, - alpha3: Alpha3TTO, + name: "Trinidad and Tobago", + alpha2: "TT", + alpha3: "TTO", } - //Tunisia represents 'Tunisia' country + // Tunisia represents 'Tunisia' country Tunisia = Country{ - name: NameTunisia, - alpha2: Alpha2TN, - alpha3: Alpha3TUN, + name: "Tunisia", + alpha2: "TN", + alpha3: "TUN", } - //Turkey represents 'Turkey' country - Turkey = Country{ - name: NameTurkey, - alpha2: Alpha2TR, - alpha3: Alpha3TUR, - } - //Turkmenistan represents 'Turkmenistan' country + // Turkmenistan represents 'Turkmenistan' country Turkmenistan = Country{ - name: NameTurkmenistan, - alpha2: Alpha2TM, - alpha3: Alpha3TKM, + name: "Turkmenistan", + alpha2: "TM", + alpha3: "TKM", } - //TurksAndCaicosIslands represents 'Turks and Caicos Islands (the)' country + // TurksAndCaicosIslands represents 'Turks and Caicos Islands (the)' country TurksAndCaicosIslands = Country{ - name: NameTurksAndCaicosIslands, - alpha2: Alpha2TC, - alpha3: Alpha3TCA, + name: "Turks and Caicos Islands (the)", + alpha2: "TC", + alpha3: "TCA", } - //Tuvalu represents 'Tuvalu' country + // Tuvalu represents 'Tuvalu' country Tuvalu = Country{ - name: NameTuvalu, - alpha2: Alpha2TV, - alpha3: Alpha3TUV, + name: "Tuvalu", + alpha2: "TV", + alpha3: "TUV", + } + // Turkiye represents 'Türkiye' country + Turkiye = Country{ + name: "Türkiye", + alpha2: "TR", + alpha3: "TUR", } - //Uganda represents 'Uganda' country + // Uganda represents 'Uganda' country Uganda = Country{ - name: NameUganda, - alpha2: Alpha2UG, - alpha3: Alpha3UGA, + name: "Uganda", + alpha2: "UG", + alpha3: "UGA", } - //Ukraine represents 'Ukraine' country + // Ukraine represents 'Ukraine' country Ukraine = Country{ - name: NameUkraine, - alpha2: Alpha2UA, - alpha3: Alpha3UKR, + name: "Ukraine", + alpha2: "UA", + alpha3: "UKR", } - //UnitedArabEmirates represents 'United Arab Emirates (the)' country + // UnitedArabEmirates represents 'United Arab Emirates (the)' country UnitedArabEmirates = Country{ - name: NameUnitedArabEmirates, - alpha2: Alpha2AE, - alpha3: Alpha3ARE, + name: "United Arab Emirates (the)", + alpha2: "AE", + alpha3: "ARE", } - //UnitedKingdomOfGreatBritainAndNorthernIreland represents 'United Kingdom of Great Britain and Northern Ireland (the)' country + // UnitedKingdomOfGreatBritainAndNorthernIreland represents 'United Kingdom of Great Britain and Northern Ireland (the)' country UnitedKingdomOfGreatBritainAndNorthernIreland = Country{ - name: NameUnitedKingdomOfGreatBritainAndNorthernIreland, - alpha2: Alpha2GB, - alpha3: Alpha3GBR, + name: "United Kingdom of Great Britain and Northern Ireland (the)", + alpha2: "GB", + alpha3: "GBR", } - //UnitedStatesMinorOutlyingIslands represents 'United States Minor Outlying Islands (the)' country + // UnitedStatesMinorOutlyingIslands represents 'United States Minor Outlying Islands (the)' country UnitedStatesMinorOutlyingIslands = Country{ - name: NameUnitedStatesMinorOutlyingIslands, - alpha2: Alpha2UM, - alpha3: Alpha3UMI, + name: "United States Minor Outlying Islands (the)", + alpha2: "UM", + alpha3: "UMI", } - //UnitedStatesOfAmerica represents 'United States of America (the)' country + // UnitedStatesOfAmerica represents 'United States of America (the)' country UnitedStatesOfAmerica = Country{ - name: NameUnitedStatesOfAmerica, - alpha2: Alpha2US, - alpha3: Alpha3USA, + name: "United States of America (the)", + alpha2: "US", + alpha3: "USA", } - //Uruguay represents 'Uruguay' country + // Uruguay represents 'Uruguay' country Uruguay = Country{ - name: NameUruguay, - alpha2: Alpha2UY, - alpha3: Alpha3URY, + name: "Uruguay", + alpha2: "UY", + alpha3: "URY", } - //Uzbekistan represents 'Uzbekistan' country + // Uzbekistan represents 'Uzbekistan' country Uzbekistan = Country{ - name: NameUzbekistan, - alpha2: Alpha2UZ, - alpha3: Alpha3UZB, + name: "Uzbekistan", + alpha2: "UZ", + alpha3: "UZB", } - //Vanuatu represents 'Vanuatu' country + // Vanuatu represents 'Vanuatu' country Vanuatu = Country{ - name: NameVanuatu, - alpha2: Alpha2VU, - alpha3: Alpha3VUT, + name: "Vanuatu", + alpha2: "VU", + alpha3: "VUT", } - //Venezuela represents 'Venezuela (Bolivarian Republic of)' country + // Venezuela represents 'Venezuela (Bolivarian Republic of)' country Venezuela = Country{ - name: NameVenezuela, - alpha2: Alpha2VE, - alpha3: Alpha3VEN, + name: "Venezuela (Bolivarian Republic of)", + alpha2: "VE", + alpha3: "VEN", } - //VietNam represents 'Viet Nam' country + // VietNam represents 'Viet Nam' country VietNam = Country{ - name: NameVietNam, - alpha2: Alpha2VN, - alpha3: Alpha3VNM, + name: "Viet Nam", + alpha2: "VN", + alpha3: "VNM", } - //BritishVirginIslands represents 'Virgin Islands (British)' country + // BritishVirginIslands represents 'Virgin Islands (British)' country BritishVirginIslands = Country{ - name: NameBritishVirginIslands, - alpha2: Alpha2VG, - alpha3: Alpha3VGB, + name: "Virgin Islands (British)", + alpha2: "VG", + alpha3: "VGB", } - //USVirginIslands represents 'Virgin Islands (U.S.)' country + // USVirginIslands represents 'Virgin Islands (U.S.)' country USVirginIslands = Country{ - name: NameUSVirginIslands, - alpha2: Alpha2VI, - alpha3: Alpha3VIR, + name: "Virgin Islands (U.S.)", + alpha2: "VI", + alpha3: "VIR", } - //WallisAndFutuna represents 'Wallis and Futuna' country + // WallisAndFutuna represents 'Wallis and Futuna' country WallisAndFutuna = Country{ - name: NameWallisAndFutuna, - alpha2: Alpha2WF, - alpha3: Alpha3WLF, + name: "Wallis and Futuna", + alpha2: "WF", + alpha3: "WLF", } - //WesternSahara represents 'Western Sahara*' country + // WesternSahara represents 'Western Sahara*' country WesternSahara = Country{ - name: NameWesternSahara, - alpha2: Alpha2EH, - alpha3: Alpha3ESH, + name: "Western Sahara*", + alpha2: "EH", + alpha3: "ESH", } - //Yemen represents 'Yemen' country + // Yemen represents 'Yemen' country Yemen = Country{ - name: NameYemen, - alpha2: Alpha2YE, - alpha3: Alpha3YEM, + name: "Yemen", + alpha2: "YE", + alpha3: "YEM", } - //Zambia represents 'Zambia' country + // Zambia represents 'Zambia' country Zambia = Country{ - name: NameZambia, - alpha2: Alpha2ZM, - alpha3: Alpha3ZMB, + name: "Zambia", + alpha2: "ZM", + alpha3: "ZMB", } - //Zimbabwe represents 'Zimbabwe' country + // Zimbabwe represents 'Zimbabwe' country Zimbabwe = Country{ - name: NameZimbabwe, - alpha2: Alpha2ZW, - alpha3: Alpha3ZWE, + name: "Zimbabwe", + alpha2: "ZW", + alpha3: "ZWE", } - //AlandIslands represents 'Åland Islands' country + // AlandIslands represents 'Åland Islands' country AlandIslands = Country{ - name: NameAlandIslands, - alpha2: Alpha2AX, - alpha3: Alpha3ALA, + name: "Åland Islands", + alpha2: "AX", + alpha3: "ALA", } ) diff --git a/country/name.go b/country/name.go new file mode 100644 index 0000000..53ca7a1 --- /dev/null +++ b/country/name.go @@ -0,0 +1,55 @@ +package country + +import ( + "database/sql/driver" + "encoding/json" +) + +// Name represents country name +type Name string + +// UnmarshalJSON unmarshall implementation for name +func (name *Name) UnmarshalJSON(data []byte) error { + var str string + if err := json.Unmarshal(data, &str); err != nil { + return err + } + + enumValue := Name(str) + if _, err := ByNameErr(enumValue); err != nil { + return err + } + + *name = enumValue + return nil +} + +// Value implementation of driver.Valuer +func (name Name) Value() (value driver.Value, err error) { + if name == "" { + return "", nil + } + + if _, err = ByNameErr(name); err != nil { + return nil, err + } + + return name.String(), nil +} + +// Validate implementation of ozzo-validation Validate interface +func (name Name) Validate() (err error) { + _, err = ByNameErr(name) + + return +} + +// IsSet indicates if Name is set +func (name Name) IsSet() bool { + return len(string(name)) > 0 +} + +// String implementation of Stringer interface +func (name Name) String() string { + return string(name) +} diff --git a/country/name/name_gen.go b/country/name/name_gen.go new file mode 100644 index 0000000..8f87466 --- /dev/null +++ b/country/name/name_gen.go @@ -0,0 +1,504 @@ +package name + +import "github.com/mikekonan/go-types/v2/country" + +const ( + // Afghanistan represents 'Afghanistan' country name + Afghanistan = country.Name("Afghanistan") + // Albania represents 'Albania' country name + Albania = country.Name("Albania") + // Algeria represents 'Algeria' country name + Algeria = country.Name("Algeria") + // AmericanSamoa represents 'American Samoa' country name + AmericanSamoa = country.Name("American Samoa") + // Andorra represents 'Andorra' country name + Andorra = country.Name("Andorra") + // Angola represents 'Angola' country name + Angola = country.Name("Angola") + // Anguilla represents 'Anguilla' country name + Anguilla = country.Name("Anguilla") + // Antarctica represents 'Antarctica' country name + Antarctica = country.Name("Antarctica") + // AntiguaAndBarbuda represents 'Antigua and Barbuda' country name + AntiguaAndBarbuda = country.Name("Antigua and Barbuda") + // Argentina represents 'Argentina' country name + Argentina = country.Name("Argentina") + // Armenia represents 'Armenia' country name + Armenia = country.Name("Armenia") + // Aruba represents 'Aruba' country name + Aruba = country.Name("Aruba") + // Australia represents 'Australia' country name + Australia = country.Name("Australia") + // Austria represents 'Austria' country name + Austria = country.Name("Austria") + // Azerbaijan represents 'Azerbaijan' country name + Azerbaijan = country.Name("Azerbaijan") + // Bahamas represents 'Bahamas (the)' country name + Bahamas = country.Name("Bahamas (the)") + // Bahrain represents 'Bahrain' country name + Bahrain = country.Name("Bahrain") + // Bangladesh represents 'Bangladesh' country name + Bangladesh = country.Name("Bangladesh") + // Barbados represents 'Barbados' country name + Barbados = country.Name("Barbados") + // Belarus represents 'Belarus' country name + Belarus = country.Name("Belarus") + // Belgium represents 'Belgium' country name + Belgium = country.Name("Belgium") + // Belize represents 'Belize' country name + Belize = country.Name("Belize") + // Benin represents 'Benin' country name + Benin = country.Name("Benin") + // Bermuda represents 'Bermuda' country name + Bermuda = country.Name("Bermuda") + // Bhutan represents 'Bhutan' country name + Bhutan = country.Name("Bhutan") + // Bolivia represents 'Bolivia (Plurinational State of)' country name + Bolivia = country.Name("Bolivia (Plurinational State of)") + // BonaireSintEustatiusAndSaba represents 'Bonaire, Sint Eustatius and Saba' country name + BonaireSintEustatiusAndSaba = country.Name("Bonaire, Sint Eustatius and Saba") + // BosniaAndHerzegovina represents 'Bosnia and Herzegovina' country name + BosniaAndHerzegovina = country.Name("Bosnia and Herzegovina") + // Botswana represents 'Botswana' country name + Botswana = country.Name("Botswana") + // BouvetIsland represents 'Bouvet Island' country name + BouvetIsland = country.Name("Bouvet Island") + // Brazil represents 'Brazil' country name + Brazil = country.Name("Brazil") + // BritishIndianOceanTerritory represents 'British Indian Ocean Territory (the)' country name + BritishIndianOceanTerritory = country.Name("British Indian Ocean Territory (the)") + // BruneiDarussalam represents 'Brunei Darussalam' country name + BruneiDarussalam = country.Name("Brunei Darussalam") + // Bulgaria represents 'Bulgaria' country name + Bulgaria = country.Name("Bulgaria") + // BurkinaFaso represents 'Burkina Faso' country name + BurkinaFaso = country.Name("Burkina Faso") + // Burundi represents 'Burundi' country name + Burundi = country.Name("Burundi") + // CaboVerde represents 'Cabo Verde' country name + CaboVerde = country.Name("Cabo Verde") + // Cambodia represents 'Cambodia' country name + Cambodia = country.Name("Cambodia") + // Cameroon represents 'Cameroon' country name + Cameroon = country.Name("Cameroon") + // Canada represents 'Canada' country name + Canada = country.Name("Canada") + // CaymanIslands represents 'Cayman Islands (the)' country name + CaymanIslands = country.Name("Cayman Islands (the)") + // CentralAfricanRepublic represents 'Central African Republic (the)' country name + CentralAfricanRepublic = country.Name("Central African Republic (the)") + // Chad represents 'Chad' country name + Chad = country.Name("Chad") + // Chile represents 'Chile' country name + Chile = country.Name("Chile") + // China represents 'China' country name + China = country.Name("China") + // ChristmasIsland represents 'Christmas Island' country name + ChristmasIsland = country.Name("Christmas Island") + // Cocos represents 'Cocos (Keeling) Islands (the)' country name + Cocos = country.Name("Cocos (Keeling) Islands (the)") + // Colombia represents 'Colombia' country name + Colombia = country.Name("Colombia") + // Comoros represents 'Comoros (the)' country name + Comoros = country.Name("Comoros (the)") + // DemocraticRepublicOfTheCongo represents 'Congo (the Democratic Republic of the)' country name + DemocraticRepublicOfTheCongo = country.Name("Congo (the Democratic Republic of the)") + // Congo represents 'Congo (the)' country name + Congo = country.Name("Congo (the)") + // CookIslands represents 'Cook Islands (the)' country name + CookIslands = country.Name("Cook Islands (the)") + // CostaRica represents 'Costa Rica' country name + CostaRica = country.Name("Costa Rica") + // Croatia represents 'Croatia' country name + Croatia = country.Name("Croatia") + // Cuba represents 'Cuba' country name + Cuba = country.Name("Cuba") + // Curacao represents 'Curaçao' country name + Curacao = country.Name("Curaçao") + // Cyprus represents 'Cyprus' country name + Cyprus = country.Name("Cyprus") + // Czechia represents 'Czechia' country name + Czechia = country.Name("Czechia") + // CoteDIvoire represents 'Côte d'Ivoire' country name + CoteDIvoire = country.Name("Côte d'Ivoire") + // Denmark represents 'Denmark' country name + Denmark = country.Name("Denmark") + // Djibouti represents 'Djibouti' country name + Djibouti = country.Name("Djibouti") + // Dominica represents 'Dominica' country name + Dominica = country.Name("Dominica") + // DominicanRepublic represents 'Dominican Republic (the)' country name + DominicanRepublic = country.Name("Dominican Republic (the)") + // Ecuador represents 'Ecuador' country name + Ecuador = country.Name("Ecuador") + // Egypt represents 'Egypt' country name + Egypt = country.Name("Egypt") + // ElSalvador represents 'El Salvador' country name + ElSalvador = country.Name("El Salvador") + // EquatorialGuinea represents 'Equatorial Guinea' country name + EquatorialGuinea = country.Name("Equatorial Guinea") + // Eritrea represents 'Eritrea' country name + Eritrea = country.Name("Eritrea") + // Estonia represents 'Estonia' country name + Estonia = country.Name("Estonia") + // Eswatini represents 'Eswatini' country name + Eswatini = country.Name("Eswatini") + // Ethiopia represents 'Ethiopia' country name + Ethiopia = country.Name("Ethiopia") + // FalklandIslands represents 'Falkland Islands (the) [Malvinas]' country name + FalklandIslands = country.Name("Falkland Islands (the) [Malvinas]") + // FaroeIslands represents 'Faroe Islands (the)' country name + FaroeIslands = country.Name("Faroe Islands (the)") + // Fiji represents 'Fiji' country name + Fiji = country.Name("Fiji") + // Finland represents 'Finland' country name + Finland = country.Name("Finland") + // France represents 'France' country name + France = country.Name("France") + // FrenchGuiana represents 'French Guiana' country name + FrenchGuiana = country.Name("French Guiana") + // FrenchPolynesia represents 'French Polynesia' country name + FrenchPolynesia = country.Name("French Polynesia") + // FrenchSouthernTerritories represents 'French Southern Territories (the)' country name + FrenchSouthernTerritories = country.Name("French Southern Territories (the)") + // Gabon represents 'Gabon' country name + Gabon = country.Name("Gabon") + // Gambia represents 'Gambia (the)' country name + Gambia = country.Name("Gambia (the)") + // Georgia represents 'Georgia' country name + Georgia = country.Name("Georgia") + // Germany represents 'Germany' country name + Germany = country.Name("Germany") + // Ghana represents 'Ghana' country name + Ghana = country.Name("Ghana") + // Gibraltar represents 'Gibraltar' country name + Gibraltar = country.Name("Gibraltar") + // Greece represents 'Greece' country name + Greece = country.Name("Greece") + // Greenland represents 'Greenland' country name + Greenland = country.Name("Greenland") + // Grenada represents 'Grenada' country name + Grenada = country.Name("Grenada") + // Guadeloupe represents 'Guadeloupe' country name + Guadeloupe = country.Name("Guadeloupe") + // Guam represents 'Guam' country name + Guam = country.Name("Guam") + // Guatemala represents 'Guatemala' country name + Guatemala = country.Name("Guatemala") + // Guernsey represents 'Guernsey' country name + Guernsey = country.Name("Guernsey") + // Guinea represents 'Guinea' country name + Guinea = country.Name("Guinea") + // GuineaBissau represents 'Guinea-Bissau' country name + GuineaBissau = country.Name("Guinea-Bissau") + // Guyana represents 'Guyana' country name + Guyana = country.Name("Guyana") + // Haiti represents 'Haiti' country name + Haiti = country.Name("Haiti") + // HeardIslandAndMcDonaldIslands represents 'Heard Island and McDonald Islands' country name + HeardIslandAndMcDonaldIslands = country.Name("Heard Island and McDonald Islands") + // HolySee represents 'Holy See (the)' country name + HolySee = country.Name("Holy See (the)") + // Honduras represents 'Honduras' country name + Honduras = country.Name("Honduras") + // HongKong represents 'Hong Kong' country name + HongKong = country.Name("Hong Kong") + // Hungary represents 'Hungary' country name + Hungary = country.Name("Hungary") + // Iceland represents 'Iceland' country name + Iceland = country.Name("Iceland") + // India represents 'India' country name + India = country.Name("India") + // Indonesia represents 'Indonesia' country name + Indonesia = country.Name("Indonesia") + // Iran represents 'Iran (Islamic Republic of)' country name + Iran = country.Name("Iran (Islamic Republic of)") + // Iraq represents 'Iraq' country name + Iraq = country.Name("Iraq") + // Ireland represents 'Ireland' country name + Ireland = country.Name("Ireland") + // IsleOfMan represents 'Isle of Man' country name + IsleOfMan = country.Name("Isle of Man") + // Israel represents 'Israel' country name + Israel = country.Name("Israel") + // Italy represents 'Italy' country name + Italy = country.Name("Italy") + // Jamaica represents 'Jamaica' country name + Jamaica = country.Name("Jamaica") + // Japan represents 'Japan' country name + Japan = country.Name("Japan") + // Jersey represents 'Jersey' country name + Jersey = country.Name("Jersey") + // Jordan represents 'Jordan' country name + Jordan = country.Name("Jordan") + // Kazakhstan represents 'Kazakhstan' country name + Kazakhstan = country.Name("Kazakhstan") + // Kenya represents 'Kenya' country name + Kenya = country.Name("Kenya") + // Kiribati represents 'Kiribati' country name + Kiribati = country.Name("Kiribati") + // NorthKorea represents 'Korea (the Democratic People's Republic of)' country name + NorthKorea = country.Name("Korea (the Democratic People's Republic of)") + // SouthKorea represents 'Korea (the Republic of)' country name + SouthKorea = country.Name("Korea (the Republic of)") + // Kuwait represents 'Kuwait' country name + Kuwait = country.Name("Kuwait") + // Kyrgyzstan represents 'Kyrgyzstan' country name + Kyrgyzstan = country.Name("Kyrgyzstan") + // LaoPeoplesDemocraticRepublic represents 'Lao People's Democratic Republic (the)' country name + LaoPeoplesDemocraticRepublic = country.Name("Lao People's Democratic Republic (the)") + // Latvia represents 'Latvia' country name + Latvia = country.Name("Latvia") + // Lebanon represents 'Lebanon' country name + Lebanon = country.Name("Lebanon") + // Lesotho represents 'Lesotho' country name + Lesotho = country.Name("Lesotho") + // Liberia represents 'Liberia' country name + Liberia = country.Name("Liberia") + // Libya represents 'Libya' country name + Libya = country.Name("Libya") + // Liechtenstein represents 'Liechtenstein' country name + Liechtenstein = country.Name("Liechtenstein") + // Lithuania represents 'Lithuania' country name + Lithuania = country.Name("Lithuania") + // Luxembourg represents 'Luxembourg' country name + Luxembourg = country.Name("Luxembourg") + // Macao represents 'Macao' country name + Macao = country.Name("Macao") + // Madagascar represents 'Madagascar' country name + Madagascar = country.Name("Madagascar") + // Malawi represents 'Malawi' country name + Malawi = country.Name("Malawi") + // Malaysia represents 'Malaysia' country name + Malaysia = country.Name("Malaysia") + // Maldives represents 'Maldives' country name + Maldives = country.Name("Maldives") + // Mali represents 'Mali' country name + Mali = country.Name("Mali") + // Malta represents 'Malta' country name + Malta = country.Name("Malta") + // MarshallIslands represents 'Marshall Islands (the)' country name + MarshallIslands = country.Name("Marshall Islands (the)") + // Martinique represents 'Martinique' country name + Martinique = country.Name("Martinique") + // Mauritania represents 'Mauritania' country name + Mauritania = country.Name("Mauritania") + // Mauritius represents 'Mauritius' country name + Mauritius = country.Name("Mauritius") + // Mayotte represents 'Mayotte' country name + Mayotte = country.Name("Mayotte") + // Mexico represents 'Mexico' country name + Mexico = country.Name("Mexico") + // Micronesia represents 'Micronesia (Federated States of)' country name + Micronesia = country.Name("Micronesia (Federated States of)") + // Moldova represents 'Moldova (the Republic of)' country name + Moldova = country.Name("Moldova (the Republic of)") + // Monaco represents 'Monaco' country name + Monaco = country.Name("Monaco") + // Mongolia represents 'Mongolia' country name + Mongolia = country.Name("Mongolia") + // Montenegro represents 'Montenegro' country name + Montenegro = country.Name("Montenegro") + // Montserrat represents 'Montserrat' country name + Montserrat = country.Name("Montserrat") + // Morocco represents 'Morocco' country name + Morocco = country.Name("Morocco") + // Mozambique represents 'Mozambique' country name + Mozambique = country.Name("Mozambique") + // Myanmar represents 'Myanmar' country name + Myanmar = country.Name("Myanmar") + // Namibia represents 'Namibia' country name + Namibia = country.Name("Namibia") + // Nauru represents 'Nauru' country name + Nauru = country.Name("Nauru") + // Nepal represents 'Nepal' country name + Nepal = country.Name("Nepal") + // Netherlands represents 'Netherlands (the)' country name + Netherlands = country.Name("Netherlands (the)") + // NewCaledonia represents 'New Caledonia' country name + NewCaledonia = country.Name("New Caledonia") + // NewZealand represents 'New Zealand' country name + NewZealand = country.Name("New Zealand") + // Nicaragua represents 'Nicaragua' country name + Nicaragua = country.Name("Nicaragua") + // Niger represents 'Niger (the)' country name + Niger = country.Name("Niger (the)") + // Nigeria represents 'Nigeria' country name + Nigeria = country.Name("Nigeria") + // Niue represents 'Niue' country name + Niue = country.Name("Niue") + // NorfolkIsland represents 'Norfolk Island' country name + NorfolkIsland = country.Name("Norfolk Island") + // NorthMacedonia represents 'North Macedonia' country name + NorthMacedonia = country.Name("North Macedonia") + // NorthernMarianaIslands represents 'Northern Mariana Islands (the)' country name + NorthernMarianaIslands = country.Name("Northern Mariana Islands (the)") + // Norway represents 'Norway' country name + Norway = country.Name("Norway") + // Oman represents 'Oman' country name + Oman = country.Name("Oman") + // Pakistan represents 'Pakistan' country name + Pakistan = country.Name("Pakistan") + // Palau represents 'Palau' country name + Palau = country.Name("Palau") + // Palestine represents 'Palestine, State of' country name + Palestine = country.Name("Palestine, State of") + // Panama represents 'Panama' country name + Panama = country.Name("Panama") + // PapuaNewGuinea represents 'Papua New Guinea' country name + PapuaNewGuinea = country.Name("Papua New Guinea") + // Paraguay represents 'Paraguay' country name + Paraguay = country.Name("Paraguay") + // Peru represents 'Peru' country name + Peru = country.Name("Peru") + // Philippines represents 'Philippines (the)' country name + Philippines = country.Name("Philippines (the)") + // Pitcairn represents 'Pitcairn' country name + Pitcairn = country.Name("Pitcairn") + // Poland represents 'Poland' country name + Poland = country.Name("Poland") + // Portugal represents 'Portugal' country name + Portugal = country.Name("Portugal") + // PuertoRico represents 'Puerto Rico' country name + PuertoRico = country.Name("Puerto Rico") + // Qatar represents 'Qatar' country name + Qatar = country.Name("Qatar") + // Romania represents 'Romania' country name + Romania = country.Name("Romania") + // RussianFederation represents 'Russian Federation (the)' country name + RussianFederation = country.Name("Russian Federation (the)") + // Rwanda represents 'Rwanda' country name + Rwanda = country.Name("Rwanda") + // Reunion represents 'Réunion' country name + Reunion = country.Name("Réunion") + // SaintBarthelemy represents 'Saint Barthélemy' country name + SaintBarthelemy = country.Name("Saint Barthélemy") + // SaintHelenaAscensionAndTristanDaCunha represents 'Saint Helena, Ascension and Tristan da Cunha' country name + SaintHelenaAscensionAndTristanDaCunha = country.Name("Saint Helena, Ascension and Tristan da Cunha") + // SaintKittsAndNevis represents 'Saint Kitts and Nevis' country name + SaintKittsAndNevis = country.Name("Saint Kitts and Nevis") + // SaintLucia represents 'Saint Lucia' country name + SaintLucia = country.Name("Saint Lucia") + // SaintMartin represents 'Saint Martin (French part)' country name + SaintMartin = country.Name("Saint Martin (French part)") + // SaintPierreAndMiquelon represents 'Saint Pierre and Miquelon' country name + SaintPierreAndMiquelon = country.Name("Saint Pierre and Miquelon") + // SaintVincentAndTheGrenadines represents 'Saint Vincent and the Grenadines' country name + SaintVincentAndTheGrenadines = country.Name("Saint Vincent and the Grenadines") + // Samoa represents 'Samoa' country name + Samoa = country.Name("Samoa") + // SanMarino represents 'San Marino' country name + SanMarino = country.Name("San Marino") + // SaoTomeAndPrincipe represents 'Sao Tome and Principe' country name + SaoTomeAndPrincipe = country.Name("Sao Tome and Principe") + // SaudiArabia represents 'Saudi Arabia' country name + SaudiArabia = country.Name("Saudi Arabia") + // Senegal represents 'Senegal' country name + Senegal = country.Name("Senegal") + // Serbia represents 'Serbia' country name + Serbia = country.Name("Serbia") + // Seychelles represents 'Seychelles' country name + Seychelles = country.Name("Seychelles") + // SierraLeone represents 'Sierra Leone' country name + SierraLeone = country.Name("Sierra Leone") + // Singapore represents 'Singapore' country name + Singapore = country.Name("Singapore") + // SintMaarten represents 'Sint Maarten (Dutch part)' country name + SintMaarten = country.Name("Sint Maarten (Dutch part)") + // Slovakia represents 'Slovakia' country name + Slovakia = country.Name("Slovakia") + // Slovenia represents 'Slovenia' country name + Slovenia = country.Name("Slovenia") + // SolomonIslands represents 'Solomon Islands' country name + SolomonIslands = country.Name("Solomon Islands") + // Somalia represents 'Somalia' country name + Somalia = country.Name("Somalia") + // SouthAfrica represents 'South Africa' country name + SouthAfrica = country.Name("South Africa") + // SouthGeorgiaAndTheSouthSandwichIslands represents 'South Georgia and the South Sandwich Islands' country name + SouthGeorgiaAndTheSouthSandwichIslands = country.Name("South Georgia and the South Sandwich Islands") + // SouthSudan represents 'South Sudan' country name + SouthSudan = country.Name("South Sudan") + // Spain represents 'Spain' country name + Spain = country.Name("Spain") + // SriLanka represents 'Sri Lanka' country name + SriLanka = country.Name("Sri Lanka") + // Sudan represents 'Sudan (the)' country name + Sudan = country.Name("Sudan (the)") + // Suriname represents 'Suriname' country name + Suriname = country.Name("Suriname") + // SvalbardAndJanMayen represents 'Svalbard and Jan Mayen' country name + SvalbardAndJanMayen = country.Name("Svalbard and Jan Mayen") + // Sweden represents 'Sweden' country name + Sweden = country.Name("Sweden") + // Switzerland represents 'Switzerland' country name + Switzerland = country.Name("Switzerland") + // SyrianArabRepublic represents 'Syrian Arab Republic (the)' country name + SyrianArabRepublic = country.Name("Syrian Arab Republic (the)") + // Taiwan represents 'Taiwan (Province of China)' country name + Taiwan = country.Name("Taiwan (Province of China)") + // Tajikistan represents 'Tajikistan' country name + Tajikistan = country.Name("Tajikistan") + // TanzaniaTheUnitedRepublicOf represents 'Tanzania, the United Republic of' country name + TanzaniaTheUnitedRepublicOf = country.Name("Tanzania, the United Republic of") + // Thailand represents 'Thailand' country name + Thailand = country.Name("Thailand") + // TimorLeste represents 'Timor-Leste' country name + TimorLeste = country.Name("Timor-Leste") + // Togo represents 'Togo' country name + Togo = country.Name("Togo") + // Tokelau represents 'Tokelau' country name + Tokelau = country.Name("Tokelau") + // Tonga represents 'Tonga' country name + Tonga = country.Name("Tonga") + // TrinidadAndTobago represents 'Trinidad and Tobago' country name + TrinidadAndTobago = country.Name("Trinidad and Tobago") + // Tunisia represents 'Tunisia' country name + Tunisia = country.Name("Tunisia") + // Turkmenistan represents 'Turkmenistan' country name + Turkmenistan = country.Name("Turkmenistan") + // TurksAndCaicosIslands represents 'Turks and Caicos Islands (the)' country name + TurksAndCaicosIslands = country.Name("Turks and Caicos Islands (the)") + // Tuvalu represents 'Tuvalu' country name + Tuvalu = country.Name("Tuvalu") + // Turkiye represents 'Türkiye' country name + Turkiye = country.Name("Türkiye") + // Uganda represents 'Uganda' country name + Uganda = country.Name("Uganda") + // Ukraine represents 'Ukraine' country name + Ukraine = country.Name("Ukraine") + // UnitedArabEmirates represents 'United Arab Emirates (the)' country name + UnitedArabEmirates = country.Name("United Arab Emirates (the)") + // UnitedKingdomOfGreatBritainAndNorthernIreland represents 'United Kingdom of Great Britain and Northern Ireland (the)' country name + UnitedKingdomOfGreatBritainAndNorthernIreland = country.Name("United Kingdom of Great Britain and Northern Ireland (the)") + // UnitedStatesMinorOutlyingIslands represents 'United States Minor Outlying Islands (the)' country name + UnitedStatesMinorOutlyingIslands = country.Name("United States Minor Outlying Islands (the)") + // UnitedStatesOfAmerica represents 'United States of America (the)' country name + UnitedStatesOfAmerica = country.Name("United States of America (the)") + // Uruguay represents 'Uruguay' country name + Uruguay = country.Name("Uruguay") + // Uzbekistan represents 'Uzbekistan' country name + Uzbekistan = country.Name("Uzbekistan") + // Vanuatu represents 'Vanuatu' country name + Vanuatu = country.Name("Vanuatu") + // Venezuela represents 'Venezuela (Bolivarian Republic of)' country name + Venezuela = country.Name("Venezuela (Bolivarian Republic of)") + // VietNam represents 'Viet Nam' country name + VietNam = country.Name("Viet Nam") + // BritishVirginIslands represents 'Virgin Islands (British)' country name + BritishVirginIslands = country.Name("Virgin Islands (British)") + // USVirginIslands represents 'Virgin Islands (U.S.)' country name + USVirginIslands = country.Name("Virgin Islands (U.S.)") + // WallisAndFutuna represents 'Wallis and Futuna' country name + WallisAndFutuna = country.Name("Wallis and Futuna") + // WesternSahara represents 'Western Sahara*' country name + WesternSahara = country.Name("Western Sahara*") + // Yemen represents 'Yemen' country name + Yemen = country.Name("Yemen") + // Zambia represents 'Zambia' country name + Zambia = country.Name("Zambia") + // Zimbabwe represents 'Zimbabwe' country name + Zimbabwe = country.Name("Zimbabwe") + // AlandIslands represents 'Åland Islands' country name + AlandIslands = country.Name("Åland Islands") +) diff --git a/country/name_gen.go b/country/name_gen.go deleted file mode 100644 index df76a59..0000000 --- a/country/name_gen.go +++ /dev/null @@ -1,502 +0,0 @@ -package country - -const ( - //NameAfghanistan represents 'Afghanistan' country name - NameAfghanistan = Name("Afghanistan") - //NameAlbania represents 'Albania' country name - NameAlbania = Name("Albania") - //NameAlgeria represents 'Algeria' country name - NameAlgeria = Name("Algeria") - //NameAmericanSamoa represents 'American Samoa' country name - NameAmericanSamoa = Name("American Samoa") - //NameAndorra represents 'Andorra' country name - NameAndorra = Name("Andorra") - //NameAngola represents 'Angola' country name - NameAngola = Name("Angola") - //NameAnguilla represents 'Anguilla' country name - NameAnguilla = Name("Anguilla") - //NameAntarctica represents 'Antarctica' country name - NameAntarctica = Name("Antarctica") - //NameAntiguaAndBarbuda represents 'Antigua and Barbuda' country name - NameAntiguaAndBarbuda = Name("Antigua and Barbuda") - //NameArgentina represents 'Argentina' country name - NameArgentina = Name("Argentina") - //NameArmenia represents 'Armenia' country name - NameArmenia = Name("Armenia") - //NameAruba represents 'Aruba' country name - NameAruba = Name("Aruba") - //NameAustralia represents 'Australia' country name - NameAustralia = Name("Australia") - //NameAustria represents 'Austria' country name - NameAustria = Name("Austria") - //NameAzerbaijan represents 'Azerbaijan' country name - NameAzerbaijan = Name("Azerbaijan") - //NameBahamas represents 'Bahamas (the)' country name - NameBahamas = Name("Bahamas (the)") - //NameBahrain represents 'Bahrain' country name - NameBahrain = Name("Bahrain") - //NameBangladesh represents 'Bangladesh' country name - NameBangladesh = Name("Bangladesh") - //NameBarbados represents 'Barbados' country name - NameBarbados = Name("Barbados") - //NameBelarus represents 'Belarus' country name - NameBelarus = Name("Belarus") - //NameBelgium represents 'Belgium' country name - NameBelgium = Name("Belgium") - //NameBelize represents 'Belize' country name - NameBelize = Name("Belize") - //NameBenin represents 'Benin' country name - NameBenin = Name("Benin") - //NameBermuda represents 'Bermuda' country name - NameBermuda = Name("Bermuda") - //NameBhutan represents 'Bhutan' country name - NameBhutan = Name("Bhutan") - //NameBolivia represents 'Bolivia (Plurinational State of)' country name - NameBolivia = Name("Bolivia (Plurinational State of)") - //NameBonaireSintEustatiusAndSaba represents 'Bonaire, Sint Eustatius and Saba' country name - NameBonaireSintEustatiusAndSaba = Name("Bonaire, Sint Eustatius and Saba") - //NameBosniaAndHerzegovina represents 'Bosnia and Herzegovina' country name - NameBosniaAndHerzegovina = Name("Bosnia and Herzegovina") - //NameBotswana represents 'Botswana' country name - NameBotswana = Name("Botswana") - //NameBouvetIsland represents 'Bouvet Island' country name - NameBouvetIsland = Name("Bouvet Island") - //NameBrazil represents 'Brazil' country name - NameBrazil = Name("Brazil") - //NameBritishIndianOceanTerritory represents 'British Indian Ocean Territory (the)' country name - NameBritishIndianOceanTerritory = Name("British Indian Ocean Territory (the)") - //NameBruneiDarussalam represents 'Brunei Darussalam' country name - NameBruneiDarussalam = Name("Brunei Darussalam") - //NameBulgaria represents 'Bulgaria' country name - NameBulgaria = Name("Bulgaria") - //NameBurkinaFaso represents 'Burkina Faso' country name - NameBurkinaFaso = Name("Burkina Faso") - //NameBurundi represents 'Burundi' country name - NameBurundi = Name("Burundi") - //NameCaboVerde represents 'Cabo Verde' country name - NameCaboVerde = Name("Cabo Verde") - //NameCambodia represents 'Cambodia' country name - NameCambodia = Name("Cambodia") - //NameCameroon represents 'Cameroon' country name - NameCameroon = Name("Cameroon") - //NameCanada represents 'Canada' country name - NameCanada = Name("Canada") - //NameCaymanIslands represents 'Cayman Islands (the)' country name - NameCaymanIslands = Name("Cayman Islands (the)") - //NameCentralAfricanRepublic represents 'Central African Republic (the)' country name - NameCentralAfricanRepublic = Name("Central African Republic (the)") - //NameChad represents 'Chad' country name - NameChad = Name("Chad") - //NameChile represents 'Chile' country name - NameChile = Name("Chile") - //NameChina represents 'China' country name - NameChina = Name("China") - //NameChristmasIsland represents 'Christmas Island' country name - NameChristmasIsland = Name("Christmas Island") - //NameCocos represents 'Cocos (Keeling) Islands (the)' country name - NameCocos = Name("Cocos (Keeling) Islands (the)") - //NameColombia represents 'Colombia' country name - NameColombia = Name("Colombia") - //NameComoros represents 'Comoros (the)' country name - NameComoros = Name("Comoros (the)") - //NameDemocraticRepublicOfTheCongo represents 'Congo (the Democratic Republic of the)' country name - NameDemocraticRepublicOfTheCongo = Name("Congo (the Democratic Republic of the)") - //NameCongo represents 'Congo (the)' country name - NameCongo = Name("Congo (the)") - //NameCookIslands represents 'Cook Islands (the)' country name - NameCookIslands = Name("Cook Islands (the)") - //NameCostaRica represents 'Costa Rica' country name - NameCostaRica = Name("Costa Rica") - //NameCroatia represents 'Croatia' country name - NameCroatia = Name("Croatia") - //NameCuba represents 'Cuba' country name - NameCuba = Name("Cuba") - //NameCuracao represents 'Curaçao' country name - NameCuracao = Name("Curaçao") - //NameCyprus represents 'Cyprus' country name - NameCyprus = Name("Cyprus") - //NameCzechia represents 'Czechia' country name - NameCzechia = Name("Czechia") - //NameCoteDIvoire represents 'Côte d'Ivoire' country name - NameCoteDIvoire = Name("Côte d'Ivoire") - //NameDenmark represents 'Denmark' country name - NameDenmark = Name("Denmark") - //NameDjibouti represents 'Djibouti' country name - NameDjibouti = Name("Djibouti") - //NameDominica represents 'Dominica' country name - NameDominica = Name("Dominica") - //NameDominicanRepublic represents 'Dominican Republic (the)' country name - NameDominicanRepublic = Name("Dominican Republic (the)") - //NameEcuador represents 'Ecuador' country name - NameEcuador = Name("Ecuador") - //NameEgypt represents 'Egypt' country name - NameEgypt = Name("Egypt") - //NameElSalvador represents 'El Salvador' country name - NameElSalvador = Name("El Salvador") - //NameEquatorialGuinea represents 'Equatorial Guinea' country name - NameEquatorialGuinea = Name("Equatorial Guinea") - //NameEritrea represents 'Eritrea' country name - NameEritrea = Name("Eritrea") - //NameEstonia represents 'Estonia' country name - NameEstonia = Name("Estonia") - //NameEswatini represents 'Eswatini' country name - NameEswatini = Name("Eswatini") - //NameEthiopia represents 'Ethiopia' country name - NameEthiopia = Name("Ethiopia") - //NameFalklandIslands represents 'Falkland Islands (the) [Malvinas]' country name - NameFalklandIslands = Name("Falkland Islands (the) [Malvinas]") - //NameFaroeIslands represents 'Faroe Islands (the)' country name - NameFaroeIslands = Name("Faroe Islands (the)") - //NameFiji represents 'Fiji' country name - NameFiji = Name("Fiji") - //NameFinland represents 'Finland' country name - NameFinland = Name("Finland") - //NameFrance represents 'France' country name - NameFrance = Name("France") - //NameFrenchGuiana represents 'French Guiana' country name - NameFrenchGuiana = Name("French Guiana") - //NameFrenchPolynesia represents 'French Polynesia' country name - NameFrenchPolynesia = Name("French Polynesia") - //NameFrenchSouthernTerritories represents 'French Southern Territories (the)' country name - NameFrenchSouthernTerritories = Name("French Southern Territories (the)") - //NameGabon represents 'Gabon' country name - NameGabon = Name("Gabon") - //NameGambia represents 'Gambia (the)' country name - NameGambia = Name("Gambia (the)") - //NameGeorgia represents 'Georgia' country name - NameGeorgia = Name("Georgia") - //NameGermany represents 'Germany' country name - NameGermany = Name("Germany") - //NameGhana represents 'Ghana' country name - NameGhana = Name("Ghana") - //NameGibraltar represents 'Gibraltar' country name - NameGibraltar = Name("Gibraltar") - //NameGreece represents 'Greece' country name - NameGreece = Name("Greece") - //NameGreenland represents 'Greenland' country name - NameGreenland = Name("Greenland") - //NameGrenada represents 'Grenada' country name - NameGrenada = Name("Grenada") - //NameGuadeloupe represents 'Guadeloupe' country name - NameGuadeloupe = Name("Guadeloupe") - //NameGuam represents 'Guam' country name - NameGuam = Name("Guam") - //NameGuatemala represents 'Guatemala' country name - NameGuatemala = Name("Guatemala") - //NameGuernsey represents 'Guernsey' country name - NameGuernsey = Name("Guernsey") - //NameGuinea represents 'Guinea' country name - NameGuinea = Name("Guinea") - //NameGuineaBissau represents 'Guinea-Bissau' country name - NameGuineaBissau = Name("Guinea-Bissau") - //NameGuyana represents 'Guyana' country name - NameGuyana = Name("Guyana") - //NameHaiti represents 'Haiti' country name - NameHaiti = Name("Haiti") - //NameHeardIslandAndMcDonaldIslands represents 'Heard Island and McDonald Islands' country name - NameHeardIslandAndMcDonaldIslands = Name("Heard Island and McDonald Islands") - //NameHolySee represents 'Holy See (the)' country name - NameHolySee = Name("Holy See (the)") - //NameHonduras represents 'Honduras' country name - NameHonduras = Name("Honduras") - //NameHongKong represents 'Hong Kong' country name - NameHongKong = Name("Hong Kong") - //NameHungary represents 'Hungary' country name - NameHungary = Name("Hungary") - //NameIceland represents 'Iceland' country name - NameIceland = Name("Iceland") - //NameIndia represents 'India' country name - NameIndia = Name("India") - //NameIndonesia represents 'Indonesia' country name - NameIndonesia = Name("Indonesia") - //NameIran represents 'Iran (Islamic Republic of)' country name - NameIran = Name("Iran (Islamic Republic of)") - //NameIraq represents 'Iraq' country name - NameIraq = Name("Iraq") - //NameIreland represents 'Ireland' country name - NameIreland = Name("Ireland") - //NameIsleOfMan represents 'Isle of Man' country name - NameIsleOfMan = Name("Isle of Man") - //NameIsrael represents 'Israel' country name - NameIsrael = Name("Israel") - //NameItaly represents 'Italy' country name - NameItaly = Name("Italy") - //NameJamaica represents 'Jamaica' country name - NameJamaica = Name("Jamaica") - //NameJapan represents 'Japan' country name - NameJapan = Name("Japan") - //NameJersey represents 'Jersey' country name - NameJersey = Name("Jersey") - //NameJordan represents 'Jordan' country name - NameJordan = Name("Jordan") - //NameKazakhstan represents 'Kazakhstan' country name - NameKazakhstan = Name("Kazakhstan") - //NameKenya represents 'Kenya' country name - NameKenya = Name("Kenya") - //NameKiribati represents 'Kiribati' country name - NameKiribati = Name("Kiribati") - //NameNorthKorea represents 'Korea (the Democratic People's Republic of)' country name - NameNorthKorea = Name("Korea (the Democratic People's Republic of)") - //NameSouthKorea represents 'Korea (the Republic of)' country name - NameSouthKorea = Name("Korea (the Republic of)") - //NameKuwait represents 'Kuwait' country name - NameKuwait = Name("Kuwait") - //NameKyrgyzstan represents 'Kyrgyzstan' country name - NameKyrgyzstan = Name("Kyrgyzstan") - //NameLaoPeoplesDemocraticRepublic represents 'Lao People's Democratic Republic (the)' country name - NameLaoPeoplesDemocraticRepublic = Name("Lao People's Democratic Republic (the)") - //NameLatvia represents 'Latvia' country name - NameLatvia = Name("Latvia") - //NameLebanon represents 'Lebanon' country name - NameLebanon = Name("Lebanon") - //NameLesotho represents 'Lesotho' country name - NameLesotho = Name("Lesotho") - //NameLiberia represents 'Liberia' country name - NameLiberia = Name("Liberia") - //NameLibya represents 'Libya' country name - NameLibya = Name("Libya") - //NameLiechtenstein represents 'Liechtenstein' country name - NameLiechtenstein = Name("Liechtenstein") - //NameLithuania represents 'Lithuania' country name - NameLithuania = Name("Lithuania") - //NameLuxembourg represents 'Luxembourg' country name - NameLuxembourg = Name("Luxembourg") - //NameMacao represents 'Macao' country name - NameMacao = Name("Macao") - //NameMadagascar represents 'Madagascar' country name - NameMadagascar = Name("Madagascar") - //NameMalawi represents 'Malawi' country name - NameMalawi = Name("Malawi") - //NameMalaysia represents 'Malaysia' country name - NameMalaysia = Name("Malaysia") - //NameMaldives represents 'Maldives' country name - NameMaldives = Name("Maldives") - //NameMali represents 'Mali' country name - NameMali = Name("Mali") - //NameMalta represents 'Malta' country name - NameMalta = Name("Malta") - //NameMarshallIslands represents 'Marshall Islands (the)' country name - NameMarshallIslands = Name("Marshall Islands (the)") - //NameMartinique represents 'Martinique' country name - NameMartinique = Name("Martinique") - //NameMauritania represents 'Mauritania' country name - NameMauritania = Name("Mauritania") - //NameMauritius represents 'Mauritius' country name - NameMauritius = Name("Mauritius") - //NameMayotte represents 'Mayotte' country name - NameMayotte = Name("Mayotte") - //NameMexico represents 'Mexico' country name - NameMexico = Name("Mexico") - //NameMicronesia represents 'Micronesia (Federated States of)' country name - NameMicronesia = Name("Micronesia (Federated States of)") - //NameMoldova represents 'Moldova (the Republic of)' country name - NameMoldova = Name("Moldova (the Republic of)") - //NameMonaco represents 'Monaco' country name - NameMonaco = Name("Monaco") - //NameMongolia represents 'Mongolia' country name - NameMongolia = Name("Mongolia") - //NameMontenegro represents 'Montenegro' country name - NameMontenegro = Name("Montenegro") - //NameMontserrat represents 'Montserrat' country name - NameMontserrat = Name("Montserrat") - //NameMorocco represents 'Morocco' country name - NameMorocco = Name("Morocco") - //NameMozambique represents 'Mozambique' country name - NameMozambique = Name("Mozambique") - //NameMyanmar represents 'Myanmar' country name - NameMyanmar = Name("Myanmar") - //NameNamibia represents 'Namibia' country name - NameNamibia = Name("Namibia") - //NameNauru represents 'Nauru' country name - NameNauru = Name("Nauru") - //NameNepal represents 'Nepal' country name - NameNepal = Name("Nepal") - //NameNetherlands represents 'Netherlands (the)' country name - NameNetherlands = Name("Netherlands (the)") - //NameNewCaledonia represents 'New Caledonia' country name - NameNewCaledonia = Name("New Caledonia") - //NameNewZealand represents 'New Zealand' country name - NameNewZealand = Name("New Zealand") - //NameNicaragua represents 'Nicaragua' country name - NameNicaragua = Name("Nicaragua") - //NameNiger represents 'Niger (the)' country name - NameNiger = Name("Niger (the)") - //NameNigeria represents 'Nigeria' country name - NameNigeria = Name("Nigeria") - //NameNiue represents 'Niue' country name - NameNiue = Name("Niue") - //NameNorfolkIsland represents 'Norfolk Island' country name - NameNorfolkIsland = Name("Norfolk Island") - //NameNorthMacedonia represents 'North Macedonia' country name - NameNorthMacedonia = Name("North Macedonia") - //NameNorthernMarianaIslands represents 'Northern Mariana Islands (the)' country name - NameNorthernMarianaIslands = Name("Northern Mariana Islands (the)") - //NameNorway represents 'Norway' country name - NameNorway = Name("Norway") - //NameOman represents 'Oman' country name - NameOman = Name("Oman") - //NamePakistan represents 'Pakistan' country name - NamePakistan = Name("Pakistan") - //NamePalau represents 'Palau' country name - NamePalau = Name("Palau") - //NamePalestine represents 'Palestine, State of' country name - NamePalestine = Name("Palestine, State of") - //NamePanama represents 'Panama' country name - NamePanama = Name("Panama") - //NamePapuaNewGuinea represents 'Papua New Guinea' country name - NamePapuaNewGuinea = Name("Papua New Guinea") - //NameParaguay represents 'Paraguay' country name - NameParaguay = Name("Paraguay") - //NamePeru represents 'Peru' country name - NamePeru = Name("Peru") - //NamePhilippines represents 'Philippines (the)' country name - NamePhilippines = Name("Philippines (the)") - //NamePitcairn represents 'Pitcairn' country name - NamePitcairn = Name("Pitcairn") - //NamePoland represents 'Poland' country name - NamePoland = Name("Poland") - //NamePortugal represents 'Portugal' country name - NamePortugal = Name("Portugal") - //NamePuertoRico represents 'Puerto Rico' country name - NamePuertoRico = Name("Puerto Rico") - //NameQatar represents 'Qatar' country name - NameQatar = Name("Qatar") - //NameRomania represents 'Romania' country name - NameRomania = Name("Romania") - //NameRussianFederation represents 'Russian Federation (the)' country name - NameRussianFederation = Name("Russian Federation (the)") - //NameRwanda represents 'Rwanda' country name - NameRwanda = Name("Rwanda") - //NameReunion represents 'Réunion' country name - NameReunion = Name("Réunion") - //NameSaintBarthelemy represents 'Saint Barthélemy' country name - NameSaintBarthelemy = Name("Saint Barthélemy") - //NameSaintHelenaAscensionAndTristanDaCunha represents 'Saint Helena, Ascension and Tristan da Cunha' country name - NameSaintHelenaAscensionAndTristanDaCunha = Name("Saint Helena, Ascension and Tristan da Cunha") - //NameSaintKittsAndNevis represents 'Saint Kitts and Nevis' country name - NameSaintKittsAndNevis = Name("Saint Kitts and Nevis") - //NameSaintLucia represents 'Saint Lucia' country name - NameSaintLucia = Name("Saint Lucia") - //NameSaintMartin represents 'Saint Martin (French part)' country name - NameSaintMartin = Name("Saint Martin (French part)") - //NameSaintPierreAndMiquelon represents 'Saint Pierre and Miquelon' country name - NameSaintPierreAndMiquelon = Name("Saint Pierre and Miquelon") - //NameSaintVincentAndTheGrenadines represents 'Saint Vincent and the Grenadines' country name - NameSaintVincentAndTheGrenadines = Name("Saint Vincent and the Grenadines") - //NameSamoa represents 'Samoa' country name - NameSamoa = Name("Samoa") - //NameSanMarino represents 'San Marino' country name - NameSanMarino = Name("San Marino") - //NameSaoTomeAndPrincipe represents 'Sao Tome and Principe' country name - NameSaoTomeAndPrincipe = Name("Sao Tome and Principe") - //NameSaudiArabia represents 'Saudi Arabia' country name - NameSaudiArabia = Name("Saudi Arabia") - //NameSenegal represents 'Senegal' country name - NameSenegal = Name("Senegal") - //NameSerbia represents 'Serbia' country name - NameSerbia = Name("Serbia") - //NameSeychelles represents 'Seychelles' country name - NameSeychelles = Name("Seychelles") - //NameSierraLeone represents 'Sierra Leone' country name - NameSierraLeone = Name("Sierra Leone") - //NameSingapore represents 'Singapore' country name - NameSingapore = Name("Singapore") - //NameSintMaarten represents 'Sint Maarten (Dutch part)' country name - NameSintMaarten = Name("Sint Maarten (Dutch part)") - //NameSlovakia represents 'Slovakia' country name - NameSlovakia = Name("Slovakia") - //NameSlovenia represents 'Slovenia' country name - NameSlovenia = Name("Slovenia") - //NameSolomonIslands represents 'Solomon Islands' country name - NameSolomonIslands = Name("Solomon Islands") - //NameSomalia represents 'Somalia' country name - NameSomalia = Name("Somalia") - //NameSouthAfrica represents 'South Africa' country name - NameSouthAfrica = Name("South Africa") - //NameSouthGeorgiaAndTheSouthSandwichIslands represents 'South Georgia and the South Sandwich Islands' country name - NameSouthGeorgiaAndTheSouthSandwichIslands = Name("South Georgia and the South Sandwich Islands") - //NameSouthSudan represents 'South Sudan' country name - NameSouthSudan = Name("South Sudan") - //NameSpain represents 'Spain' country name - NameSpain = Name("Spain") - //NameSriLanka represents 'Sri Lanka' country name - NameSriLanka = Name("Sri Lanka") - //NameSudan represents 'Sudan (the)' country name - NameSudan = Name("Sudan (the)") - //NameSuriname represents 'Suriname' country name - NameSuriname = Name("Suriname") - //NameSvalbardAndJanMayen represents 'Svalbard and Jan Mayen' country name - NameSvalbardAndJanMayen = Name("Svalbard and Jan Mayen") - //NameSweden represents 'Sweden' country name - NameSweden = Name("Sweden") - //NameSwitzerland represents 'Switzerland' country name - NameSwitzerland = Name("Switzerland") - //NameSyrianArabRepublic represents 'Syrian Arab Republic (the)' country name - NameSyrianArabRepublic = Name("Syrian Arab Republic (the)") - //NameTaiwan represents 'Taiwan (Province of China)' country name - NameTaiwan = Name("Taiwan (Province of China)") - //NameTajikistan represents 'Tajikistan' country name - NameTajikistan = Name("Tajikistan") - //NameTanzaniaTheUnitedRepublicOf represents 'Tanzania, the United Republic of' country name - NameTanzaniaTheUnitedRepublicOf = Name("Tanzania, the United Republic of") - //NameThailand represents 'Thailand' country name - NameThailand = Name("Thailand") - //NameTimorLeste represents 'Timor-Leste' country name - NameTimorLeste = Name("Timor-Leste") - //NameTogo represents 'Togo' country name - NameTogo = Name("Togo") - //NameTokelau represents 'Tokelau' country name - NameTokelau = Name("Tokelau") - //NameTonga represents 'Tonga' country name - NameTonga = Name("Tonga") - //NameTrinidadAndTobago represents 'Trinidad and Tobago' country name - NameTrinidadAndTobago = Name("Trinidad and Tobago") - //NameTunisia represents 'Tunisia' country name - NameTunisia = Name("Tunisia") - //NameTurkey represents 'Turkey' country name - NameTurkey = Name("Turkey") - //NameTurkmenistan represents 'Turkmenistan' country name - NameTurkmenistan = Name("Turkmenistan") - //NameTurksAndCaicosIslands represents 'Turks and Caicos Islands (the)' country name - NameTurksAndCaicosIslands = Name("Turks and Caicos Islands (the)") - //NameTuvalu represents 'Tuvalu' country name - NameTuvalu = Name("Tuvalu") - //NameUganda represents 'Uganda' country name - NameUganda = Name("Uganda") - //NameUkraine represents 'Ukraine' country name - NameUkraine = Name("Ukraine") - //NameUnitedArabEmirates represents 'United Arab Emirates (the)' country name - NameUnitedArabEmirates = Name("United Arab Emirates (the)") - //NameUnitedKingdomOfGreatBritainAndNorthernIreland represents 'United Kingdom of Great Britain and Northern Ireland (the)' country name - NameUnitedKingdomOfGreatBritainAndNorthernIreland = Name("United Kingdom of Great Britain and Northern Ireland (the)") - //NameUnitedStatesMinorOutlyingIslands represents 'United States Minor Outlying Islands (the)' country name - NameUnitedStatesMinorOutlyingIslands = Name("United States Minor Outlying Islands (the)") - //NameUnitedStatesOfAmerica represents 'United States of America (the)' country name - NameUnitedStatesOfAmerica = Name("United States of America (the)") - //NameUruguay represents 'Uruguay' country name - NameUruguay = Name("Uruguay") - //NameUzbekistan represents 'Uzbekistan' country name - NameUzbekistan = Name("Uzbekistan") - //NameVanuatu represents 'Vanuatu' country name - NameVanuatu = Name("Vanuatu") - //NameVenezuela represents 'Venezuela (Bolivarian Republic of)' country name - NameVenezuela = Name("Venezuela (Bolivarian Republic of)") - //NameVietNam represents 'Viet Nam' country name - NameVietNam = Name("Viet Nam") - //NameBritishVirginIslands represents 'Virgin Islands (British)' country name - NameBritishVirginIslands = Name("Virgin Islands (British)") - //NameUSVirginIslands represents 'Virgin Islands (U.S.)' country name - NameUSVirginIslands = Name("Virgin Islands (U.S.)") - //NameWallisAndFutuna represents 'Wallis and Futuna' country name - NameWallisAndFutuna = Name("Wallis and Futuna") - //NameWesternSahara represents 'Western Sahara*' country name - NameWesternSahara = Name("Western Sahara*") - //NameYemen represents 'Yemen' country name - NameYemen = Name("Yemen") - //NameZambia represents 'Zambia' country name - NameZambia = Name("Zambia") - //NameZimbabwe represents 'Zimbabwe' country name - NameZimbabwe = Name("Zimbabwe") - //NameAlandIslands represents 'Åland Islands' country name - NameAlandIslands = Name("Åland Islands") -) diff --git a/currency/.generator/generator.js b/currency/.generator/generator.js index be01312..961bae0 100644 --- a/currency/.generator/generator.js +++ b/currency/.generator/generator.js @@ -13,15 +13,24 @@ if (resp.statusCode !== 200) { os.exit(1); } -let render = (currencies) => { - let currenciesByCodeMap = {}; - let currenciesByNumberMap = {}; - let currenciesByCountryMap = {}; - let currenciesByCurrencyMap = {}; +let currencyCodes = (currencies) => { + let temp = {} + currencies.forEach((c) => { + if (!!!temp[c.code]) { + temp[c.code] = { + code: c.code, + }; + } + }) + + return temp +} +let currenciesByCodeMap = (currencies) => { + let temp = {} currencies.forEach((c) => { - if (!!!currenciesByCodeMap[c.code]) { - currenciesByCodeMap[c.code] = { + if (!!!temp[c.code]) { + temp[c.code] = { countries: [c.country], currency: c.currency, code: c.code, @@ -32,12 +41,17 @@ let render = (currencies) => { return; } - currenciesByCodeMap[c.code].countries.push(c.country); + temp[c.code].countries.push(c.country); }); + return temp +} + +let currenciesByNumberMap = (currencies) => { + let temp = {} currencies.forEach((c) => { - if (!!!currenciesByNumberMap[c.number]) { - currenciesByNumberMap[c.number] = { + if (!!!temp[c.number]) { + temp[c.number] = { countries: [c.country], currency: c.currency, code: c.code, @@ -48,25 +62,35 @@ let render = (currencies) => { return; } - currenciesByNumberMap[c.number].countries.push(c.country); + temp[c.number].countries.push(c.country); }); + return temp +} + +let currenciesByCountryMap = (currencies) => { + let temp = {} currencies.forEach((c) => { - if (!!currenciesByCountryMap[c.country]) { - currenciesByCountryMap[c.country].currencies.push(c); + if (!!temp[c.country]) { + temp[c.country].currencies.push(c); return; } - currenciesByCountryMap[c.country] = { + temp[c.country] = { currencies: [c], }; return; }); + return temp +} + +let currenciesByCurrencyMap = (currencies) => { + let temp = {} currencies.forEach((c) => { - if (!!!currenciesByCurrencyMap[c.currency]) { - currenciesByCurrencyMap[c.currency] = { + if (!!!temp[c.currency]) { + temp[c.currency] = { countries: [c.country], currency: c.currency, code: c.code, @@ -77,68 +101,81 @@ let render = (currencies) => { return; } - currenciesByCurrencyMap[c.currency].countries.push(c.country); + temp[c.currency].countries.push(c.country); }); - let renderByCountry = (currenciesMap) => { - return Object.keys(currenciesMap) - .map( - (key) => `\`${key}\`: { - ${currenciesMap[key].currencies - .map((c) => { - return `{ - countries: Countries{${currenciesByCodeMap[ - c.code - ].countries - .map((country) => `\`${country}\``) - .join(", ")}}, - currency: \`${c.currency}\`, - code: \`${c.code}\`, - number: \`${c.number}\`, - decimalPlaces: ${c.decimalPlaces}, - }`; - }) - .join(`,`)}, - }` - ) - .join(`,`); - }; + return temp +} - let render = (currenciesMap) => { - return Object.keys(currenciesMap).map( - (key) => `\`${key}\`: { +let renderByCountry = (currenciesMap, currenciesByCodeMap) => { + return Object.keys(currenciesMap).map( + (key) => `\`${key}\`: { + ${currenciesMap[key].currencies.map((c) => { + return `{ + countries: Countries{${currenciesByCodeMap[c.code].countries + .map((country) => `\`${country}\``).join(", ")}}, + currency: \`${c.currency}\`, + code: \`${c.code}\`, + number: \`${c.number}\`, + decimalPlaces: ${c.decimalPlaces}, + }`; + }) + .join(`,`)}, + }` + ) + .join(`,`); +}; + +let renderCodes = (currenciesMap) => { + return Object.keys(currenciesMap).map( + (key) => `\t// ${key} represents '${key}' currency code + ${key} = currency.Code("${key}")` + ).join("\n"); +}; + +let render = (currenciesMap) => { + return Object.keys(currenciesMap).map( + (key) => `\`${key}\`: { countries: Countries{${currenciesMap[key].countries - .map((country) => `\`${country}\``) - .join(", ")}}, + .map((country) => `\`${country}\``) + .join(", ")}}, currency: \`${currenciesMap[key].currency}\`, code: \`${currenciesMap[key].code}\`, number: \`${currenciesMap[key].number}\`, decimalPlaces: ${currenciesMap[key].decimalPlaces}, }` - ).join(`, + ).join(`, `); - }; +}; - let template = `package currency +let renderCurrencyCodesTemplate = (currencies) => { + return `package code + +import "github.com/mikekonan/go-types/v2/currency" + +const ( +${renderCodes(currencyCodes(currencies))} +)` +}; + +let renderCurrencyMappingTemplate = (currencies) => { + return `package currency var currenciesByCode = map[string]currency{ - ${render(currenciesByCodeMap)}, + ${render(currenciesByCodeMap(currencies))}, } var currenciesByNumber = map[string]currency{ - ${render(currenciesByNumberMap)}, + ${render(currenciesByNumberMap(currencies))}, } var currenciesByCountry = map[string]currencies{ - ${renderByCountry(currenciesByCountryMap)}, + ${renderByCountry(currenciesByCountryMap(currencies), currenciesByCodeMap(currencies))}, } var currenciesByCurrency = map[string]currency{ - ${render(currenciesByCurrencyMap)}, -} -`; - - return template; + ${render(currenciesByCurrencyMap(currencies))}, +}`; }; let normalizeCurrency = (currency) => { @@ -226,9 +263,10 @@ let goCodePromise = xml2js return result.concat(normalizedCountries); }) - .then((currencies) => - fs.writeFileSync("../currency_gen.go", render(currencies)) - ); + .then((currencies) => { + fs.writeFileSync("../code/code_gen.go", renderCurrencyCodesTemplate(currencies)) + fs.writeFileSync("../currencies_mapping_gen.go", renderCurrencyMappingTemplate(currencies)) + }); let oas3Promise = xml2js .parseStringPromise(resp.body.toString(), {mergeAttrs: true}) @@ -270,19 +308,19 @@ let oas3Promise = xml2js maxLength: 3, format: "iso4217-currency-code", enum: [...new Set(result.map((currency) => currency.code))], - "x-go-type": "github.com/mikekonan/go-types/currency.Code", + "x-go-type": "github.com/mikekonan/go-types/v2/currency.Code", }, CurrencyName: { example: "Euro", type: "string", enum: [...new Set(result.map((currency) => currency.currency))], - "x-go-type": "github.com/mikekonan/go-types/currency.Currency", + "x-go-type": "github.com/mikekonan/go-types/v2/currency.Currency", }, CurrencyCountry: { example: "PUERTO RICO", type: "string", enum: [...new Set(result.map((currency) => currency.country))], - "x-go-type": "github.com/mikekonan/go-types/currency.Country", + "x-go-type": "github.com/mikekonan/go-types/v2/currency.Country", }, CurrencyNumber: { example: "840", diff --git a/currency/code.go b/currency/code.go new file mode 100644 index 0000000..fabf097 --- /dev/null +++ b/currency/code.go @@ -0,0 +1,66 @@ +package currency + +import ( + "database/sql/driver" + "encoding/json" + "fmt" +) + +// Code represents a code type from ISO-4217 +type Code string + +// Value implementation of driver.Valuer +func (code Code) Value() (value driver.Value, err error) { + if code == "" { + return "", nil + } + + if err = code.Validate(); err != nil { + return nil, err + } + + return code.String(), nil +} + +// UnmarshalJSON unmarshall implementation for Code +func (code *Code) UnmarshalJSON(data []byte) error { + var str string + if err := json.Unmarshal(data, &str); err != nil { + return err + } + + currency, err := ByCodeStrErr(str) + if err != nil { + return err + } + + *code = currency.Code() + + return nil +} + +// Validate implementation of ozzo-validation Validate interface +func (code Code) Validate() error { + if _, ok := ByCodeStr(string(code)); !ok { + return fmt.Errorf("'%s' is not valid ISO-4217 code", code) + } + + return nil +} + +// IsSet indicates if Code is set +func (code Code) IsSet() bool { + return len(string(code)) > 0 +} + +// String implementation of Stringer interface +func (code Code) String() string { + return string(code) +} + +// Places returns number of digits after the dot. E.g. 2 for USD, 0 for currencies which do not support fractions +func (code Code) Places() int { + curr, _ := ByCodeStr(string(code)) + + return curr.DecimalPlaces() +} diff --git a/currency/code/code_gen.go b/currency/code/code_gen.go new file mode 100644 index 0000000..8e742d9 --- /dev/null +++ b/currency/code/code_gen.go @@ -0,0 +1,348 @@ +package code + +import "github.com/mikekonan/go-types/v2/currency" + +const ( + // AFN represents 'AFN' currency code + AFN = currency.Code("AFN") + // EUR represents 'EUR' currency code + EUR = currency.Code("EUR") + // ALL represents 'ALL' currency code + ALL = currency.Code("ALL") + // DZD represents 'DZD' currency code + DZD = currency.Code("DZD") + // USD represents 'USD' currency code + USD = currency.Code("USD") + // AOA represents 'AOA' currency code + AOA = currency.Code("AOA") + // XCD represents 'XCD' currency code + XCD = currency.Code("XCD") + // ARS represents 'ARS' currency code + ARS = currency.Code("ARS") + // AMD represents 'AMD' currency code + AMD = currency.Code("AMD") + // AWG represents 'AWG' currency code + AWG = currency.Code("AWG") + // AUD represents 'AUD' currency code + AUD = currency.Code("AUD") + // AZN represents 'AZN' currency code + AZN = currency.Code("AZN") + // BSD represents 'BSD' currency code + BSD = currency.Code("BSD") + // BHD represents 'BHD' currency code + BHD = currency.Code("BHD") + // BDT represents 'BDT' currency code + BDT = currency.Code("BDT") + // BBD represents 'BBD' currency code + BBD = currency.Code("BBD") + // BYN represents 'BYN' currency code + BYN = currency.Code("BYN") + // BZD represents 'BZD' currency code + BZD = currency.Code("BZD") + // XOF represents 'XOF' currency code + XOF = currency.Code("XOF") + // BMD represents 'BMD' currency code + BMD = currency.Code("BMD") + // INR represents 'INR' currency code + INR = currency.Code("INR") + // BTN represents 'BTN' currency code + BTN = currency.Code("BTN") + // BOB represents 'BOB' currency code + BOB = currency.Code("BOB") + // BOV represents 'BOV' currency code + BOV = currency.Code("BOV") + // BAM represents 'BAM' currency code + BAM = currency.Code("BAM") + // BWP represents 'BWP' currency code + BWP = currency.Code("BWP") + // NOK represents 'NOK' currency code + NOK = currency.Code("NOK") + // BRL represents 'BRL' currency code + BRL = currency.Code("BRL") + // BND represents 'BND' currency code + BND = currency.Code("BND") + // BGN represents 'BGN' currency code + BGN = currency.Code("BGN") + // BIF represents 'BIF' currency code + BIF = currency.Code("BIF") + // CVE represents 'CVE' currency code + CVE = currency.Code("CVE") + // KHR represents 'KHR' currency code + KHR = currency.Code("KHR") + // XAF represents 'XAF' currency code + XAF = currency.Code("XAF") + // CAD represents 'CAD' currency code + CAD = currency.Code("CAD") + // KYD represents 'KYD' currency code + KYD = currency.Code("KYD") + // CLP represents 'CLP' currency code + CLP = currency.Code("CLP") + // CLF represents 'CLF' currency code + CLF = currency.Code("CLF") + // CNY represents 'CNY' currency code + CNY = currency.Code("CNY") + // COP represents 'COP' currency code + COP = currency.Code("COP") + // COU represents 'COU' currency code + COU = currency.Code("COU") + // KMF represents 'KMF' currency code + KMF = currency.Code("KMF") + // CDF represents 'CDF' currency code + CDF = currency.Code("CDF") + // NZD represents 'NZD' currency code + NZD = currency.Code("NZD") + // CRC represents 'CRC' currency code + CRC = currency.Code("CRC") + // HRK represents 'HRK' currency code + HRK = currency.Code("HRK") + // CUP represents 'CUP' currency code + CUP = currency.Code("CUP") + // CUC represents 'CUC' currency code + CUC = currency.Code("CUC") + // ANG represents 'ANG' currency code + ANG = currency.Code("ANG") + // CZK represents 'CZK' currency code + CZK = currency.Code("CZK") + // DKK represents 'DKK' currency code + DKK = currency.Code("DKK") + // DJF represents 'DJF' currency code + DJF = currency.Code("DJF") + // DOP represents 'DOP' currency code + DOP = currency.Code("DOP") + // EGP represents 'EGP' currency code + EGP = currency.Code("EGP") + // SVC represents 'SVC' currency code + SVC = currency.Code("SVC") + // ERN represents 'ERN' currency code + ERN = currency.Code("ERN") + // SZL represents 'SZL' currency code + SZL = currency.Code("SZL") + // ETB represents 'ETB' currency code + ETB = currency.Code("ETB") + // FKP represents 'FKP' currency code + FKP = currency.Code("FKP") + // FJD represents 'FJD' currency code + FJD = currency.Code("FJD") + // XPF represents 'XPF' currency code + XPF = currency.Code("XPF") + // GMD represents 'GMD' currency code + GMD = currency.Code("GMD") + // GEL represents 'GEL' currency code + GEL = currency.Code("GEL") + // GHS represents 'GHS' currency code + GHS = currency.Code("GHS") + // GIP represents 'GIP' currency code + GIP = currency.Code("GIP") + // GTQ represents 'GTQ' currency code + GTQ = currency.Code("GTQ") + // GBP represents 'GBP' currency code + GBP = currency.Code("GBP") + // GNF represents 'GNF' currency code + GNF = currency.Code("GNF") + // GYD represents 'GYD' currency code + GYD = currency.Code("GYD") + // HTG represents 'HTG' currency code + HTG = currency.Code("HTG") + // HNL represents 'HNL' currency code + HNL = currency.Code("HNL") + // HKD represents 'HKD' currency code + HKD = currency.Code("HKD") + // HUF represents 'HUF' currency code + HUF = currency.Code("HUF") + // ISK represents 'ISK' currency code + ISK = currency.Code("ISK") + // IDR represents 'IDR' currency code + IDR = currency.Code("IDR") + // XDR represents 'XDR' currency code + XDR = currency.Code("XDR") + // IRR represents 'IRR' currency code + IRR = currency.Code("IRR") + // IQD represents 'IQD' currency code + IQD = currency.Code("IQD") + // ILS represents 'ILS' currency code + ILS = currency.Code("ILS") + // JMD represents 'JMD' currency code + JMD = currency.Code("JMD") + // JPY represents 'JPY' currency code + JPY = currency.Code("JPY") + // JOD represents 'JOD' currency code + JOD = currency.Code("JOD") + // KZT represents 'KZT' currency code + KZT = currency.Code("KZT") + // KES represents 'KES' currency code + KES = currency.Code("KES") + // KPW represents 'KPW' currency code + KPW = currency.Code("KPW") + // KRW represents 'KRW' currency code + KRW = currency.Code("KRW") + // KWD represents 'KWD' currency code + KWD = currency.Code("KWD") + // KGS represents 'KGS' currency code + KGS = currency.Code("KGS") + // LAK represents 'LAK' currency code + LAK = currency.Code("LAK") + // LBP represents 'LBP' currency code + LBP = currency.Code("LBP") + // LSL represents 'LSL' currency code + LSL = currency.Code("LSL") + // ZAR represents 'ZAR' currency code + ZAR = currency.Code("ZAR") + // LRD represents 'LRD' currency code + LRD = currency.Code("LRD") + // LYD represents 'LYD' currency code + LYD = currency.Code("LYD") + // CHF represents 'CHF' currency code + CHF = currency.Code("CHF") + // MOP represents 'MOP' currency code + MOP = currency.Code("MOP") + // MKD represents 'MKD' currency code + MKD = currency.Code("MKD") + // MGA represents 'MGA' currency code + MGA = currency.Code("MGA") + // MWK represents 'MWK' currency code + MWK = currency.Code("MWK") + // MYR represents 'MYR' currency code + MYR = currency.Code("MYR") + // MVR represents 'MVR' currency code + MVR = currency.Code("MVR") + // MRU represents 'MRU' currency code + MRU = currency.Code("MRU") + // MUR represents 'MUR' currency code + MUR = currency.Code("MUR") + // XUA represents 'XUA' currency code + XUA = currency.Code("XUA") + // MXN represents 'MXN' currency code + MXN = currency.Code("MXN") + // MXV represents 'MXV' currency code + MXV = currency.Code("MXV") + // MDL represents 'MDL' currency code + MDL = currency.Code("MDL") + // MNT represents 'MNT' currency code + MNT = currency.Code("MNT") + // MAD represents 'MAD' currency code + MAD = currency.Code("MAD") + // MZN represents 'MZN' currency code + MZN = currency.Code("MZN") + // MMK represents 'MMK' currency code + MMK = currency.Code("MMK") + // NAD represents 'NAD' currency code + NAD = currency.Code("NAD") + // NPR represents 'NPR' currency code + NPR = currency.Code("NPR") + // NIO represents 'NIO' currency code + NIO = currency.Code("NIO") + // NGN represents 'NGN' currency code + NGN = currency.Code("NGN") + // OMR represents 'OMR' currency code + OMR = currency.Code("OMR") + // PKR represents 'PKR' currency code + PKR = currency.Code("PKR") + // PAB represents 'PAB' currency code + PAB = currency.Code("PAB") + // PGK represents 'PGK' currency code + PGK = currency.Code("PGK") + // PYG represents 'PYG' currency code + PYG = currency.Code("PYG") + // PEN represents 'PEN' currency code + PEN = currency.Code("PEN") + // PHP represents 'PHP' currency code + PHP = currency.Code("PHP") + // PLN represents 'PLN' currency code + PLN = currency.Code("PLN") + // QAR represents 'QAR' currency code + QAR = currency.Code("QAR") + // RON represents 'RON' currency code + RON = currency.Code("RON") + // RUB represents 'RUB' currency code + RUB = currency.Code("RUB") + // RWF represents 'RWF' currency code + RWF = currency.Code("RWF") + // SHP represents 'SHP' currency code + SHP = currency.Code("SHP") + // WST represents 'WST' currency code + WST = currency.Code("WST") + // STN represents 'STN' currency code + STN = currency.Code("STN") + // SAR represents 'SAR' currency code + SAR = currency.Code("SAR") + // RSD represents 'RSD' currency code + RSD = currency.Code("RSD") + // SCR represents 'SCR' currency code + SCR = currency.Code("SCR") + // SLL represents 'SLL' currency code + SLL = currency.Code("SLL") + // SLE represents 'SLE' currency code + SLE = currency.Code("SLE") + // SGD represents 'SGD' currency code + SGD = currency.Code("SGD") + // XSU represents 'XSU' currency code + XSU = currency.Code("XSU") + // SBD represents 'SBD' currency code + SBD = currency.Code("SBD") + // SOS represents 'SOS' currency code + SOS = currency.Code("SOS") + // SSP represents 'SSP' currency code + SSP = currency.Code("SSP") + // LKR represents 'LKR' currency code + LKR = currency.Code("LKR") + // SDG represents 'SDG' currency code + SDG = currency.Code("SDG") + // SRD represents 'SRD' currency code + SRD = currency.Code("SRD") + // SEK represents 'SEK' currency code + SEK = currency.Code("SEK") + // CHE represents 'CHE' currency code + CHE = currency.Code("CHE") + // CHW represents 'CHW' currency code + CHW = currency.Code("CHW") + // SYP represents 'SYP' currency code + SYP = currency.Code("SYP") + // TWD represents 'TWD' currency code + TWD = currency.Code("TWD") + // TJS represents 'TJS' currency code + TJS = currency.Code("TJS") + // TZS represents 'TZS' currency code + TZS = currency.Code("TZS") + // THB represents 'THB' currency code + THB = currency.Code("THB") + // TOP represents 'TOP' currency code + TOP = currency.Code("TOP") + // TTD represents 'TTD' currency code + TTD = currency.Code("TTD") + // TND represents 'TND' currency code + TND = currency.Code("TND") + // TRY represents 'TRY' currency code + TRY = currency.Code("TRY") + // TMT represents 'TMT' currency code + TMT = currency.Code("TMT") + // UGX represents 'UGX' currency code + UGX = currency.Code("UGX") + // UAH represents 'UAH' currency code + UAH = currency.Code("UAH") + // AED represents 'AED' currency code + AED = currency.Code("AED") + // USN represents 'USN' currency code + USN = currency.Code("USN") + // UYU represents 'UYU' currency code + UYU = currency.Code("UYU") + // UYI represents 'UYI' currency code + UYI = currency.Code("UYI") + // UYW represents 'UYW' currency code + UYW = currency.Code("UYW") + // UZS represents 'UZS' currency code + UZS = currency.Code("UZS") + // VUV represents 'VUV' currency code + VUV = currency.Code("VUV") + // VES represents 'VES' currency code + VES = currency.Code("VES") + // VED represents 'VED' currency code + VED = currency.Code("VED") + // VND represents 'VND' currency code + VND = currency.Code("VND") + // YER represents 'YER' currency code + YER = currency.Code("YER") + // ZMW represents 'ZMW' currency code + ZMW = currency.Code("ZMW") + // ZWL represents 'ZWL' currency code + ZWL = currency.Code("ZWL") +) diff --git a/currency/country.go b/currency/country.go new file mode 100644 index 0000000..4e3b99e --- /dev/null +++ b/currency/country.go @@ -0,0 +1,73 @@ +package currency + +import ( + "database/sql/driver" + "encoding/json" + "fmt" +) + +// Country represents a country type from ISO-4217 +type Country string + +// Value implementation of driver.Valuer +func (country Country) Value() (value driver.Value, err error) { + if country == "" { + return "", nil + } + + if err = country.Validate(); err != nil { + return nil, err + } + + return country.String(), nil +} + +// UnmarshalJSON unmarshall implementation for Country +func (country *Country) UnmarshalJSON(data []byte) error { + var str string + if err := json.Unmarshal(data, &str); err != nil { + return err + } + + _, err := ByCountryStrErr(str) + if err != nil { + return err + } + + *country = Country(str) + + return nil +} + +// Validate implementation of ozzo-validation Validate interface +func (country Country) Validate() error { + if _, ok := ByCountryStr(string(country)); !ok { + return fmt.Errorf("'%s' is not valid ISO-4217 country", country) + } + + return nil +} + +// IsSet indicates if Country is set +func (country Country) IsSet() bool { + return len(string(country)) > 0 +} + +// String implementation of Stringer interface +func (country Country) String() string { + return string(country) +} + +// Countries is a Country slice type +type Countries []Country + +// IsCountryIn Checks there is a country in Countries +func (countries Countries) IsCountryIn(country string) bool { + for _, c := range countries { + if string(c) == country { + return true + } + } + + return false +} diff --git a/currency/currency_gen.go b/currency/currencies_mapping_gen.go similarity index 99% rename from currency/currency_gen.go rename to currency/currencies_mapping_gen.go index e6d414a..0cb3805 100644 --- a/currency/currency_gen.go +++ b/currency/currencies_mapping_gen.go @@ -939,6 +939,13 @@ var currenciesByCode = map[string]currency{ number: `694`, decimalPlaces: 2, }, + `SLE`: { + countries: Countries{`SIERRA LEONE`}, + currency: `Leone`, + code: `SLE`, + number: `925`, + decimalPlaces: 2, + }, `SGD`: { countries: Countries{`SINGAPORE`}, currency: `Singapore Dollar`, @@ -1156,6 +1163,13 @@ var currenciesByCode = map[string]currency{ number: `928`, decimalPlaces: 2, }, + `VED`: { + countries: Countries{`VENEZUELA (BOLIVARIAN REPUBLIC OF)`, `VENEZUELA`}, + currency: `Bolívar Soberano`, + code: `VED`, + number: `926`, + decimalPlaces: 2, + }, `VND`: { countries: Countries{`VIET NAM`}, currency: `Dong`, @@ -1950,6 +1964,20 @@ var currenciesByNumber = map[string]currency{ number: `901`, decimalPlaces: 2, }, + `925`: { + countries: Countries{`SIERRA LEONE`}, + currency: `Leone`, + code: `SLE`, + number: `925`, + decimalPlaces: 2, + }, + `926`: { + countries: Countries{`VENEZUELA (BOLIVARIAN REPUBLIC OF)`, `VENEZUELA`}, + currency: `Bolívar Soberano`, + code: `VED`, + number: `926`, + decimalPlaces: 2, + }, `927`: { countries: Countries{`URUGUAY`}, currency: `Unidad Previsional`, @@ -4046,6 +4074,12 @@ var currenciesByCountry = map[string]currencies{ code: `SLL`, number: `694`, decimalPlaces: 2, + }, { + countries: Countries{`SIERRA LEONE`}, + currency: `Leone`, + code: `SLE`, + number: `925`, + decimalPlaces: 2, }, }, `SINGAPORE`: { { @@ -4404,6 +4438,12 @@ var currenciesByCountry = map[string]currencies{ code: `VES`, number: `928`, decimalPlaces: 2, + }, { + countries: Countries{`VENEZUELA (BOLIVARIAN REPUBLIC OF)`, `VENEZUELA`}, + currency: `Bolívar Soberano`, + code: `VED`, + number: `926`, + decimalPlaces: 2, }, }, `VIET NAM`: { { @@ -4788,6 +4828,12 @@ var currenciesByCountry = map[string]currencies{ code: `VES`, number: `928`, decimalPlaces: 2, + }, { + countries: Countries{`VENEZUELA (BOLIVARIAN REPUBLIC OF)`, `VENEZUELA`}, + currency: `Bolívar Soberano`, + code: `VED`, + number: `926`, + decimalPlaces: 2, }, }, `VIRGIN ISLANDS`: { { @@ -5739,7 +5785,7 @@ var currenciesByCurrency = map[string]currency{ decimalPlaces: 2, }, `Leone`: { - countries: Countries{`SIERRA LEONE`}, + countries: Countries{`SIERRA LEONE`, `SIERRA LEONE`}, currency: `Leone`, code: `SLL`, number: `694`, @@ -5956,7 +6002,7 @@ var currenciesByCurrency = map[string]currency{ decimalPlaces: 0, }, `Bolívar Soberano`: { - countries: Countries{`VENEZUELA (BOLIVARIAN REPUBLIC OF)`, `VENEZUELA`}, + countries: Countries{`VENEZUELA (BOLIVARIAN REPUBLIC OF)`, `VENEZUELA (BOLIVARIAN REPUBLIC OF)`, `VENEZUELA`, `VENEZUELA`}, currency: `Bolívar Soberano`, code: `VES`, number: `928`, diff --git a/currency/currency.go b/currency/currency.go index 56b1188..2f997e3 100644 --- a/currency/currency.go +++ b/currency/currency.go @@ -8,238 +8,9 @@ Author Mikalai Konan(mikalai.konan@icloud.com). package currency import ( - "database/sql/driver" - "encoding/json" "fmt" ) -//Country represents a country type from ISO-4217 -type Country string - -//Value implementation of driver.Valuer -func (country Country) Value() (value driver.Value, err error) { - if country == "" { - return "", nil - } - - if err = country.Validate(); err != nil { - return nil, err - } - - return country.String(), nil -} - -//UnmarshalJSON unmarshall implementation for Country -func (country *Country) UnmarshalJSON(data []byte) error { - var str string - if err := json.Unmarshal(data, &str); err != nil { - return err - } - - _, err := ByCountryStrErr(str) - if err != nil { - return err - } - - *country = Country(str) - - return nil -} - -//Validate implementation of ozzo-validation Validate interface -func (country Country) Validate() error { - if _, ok := ByCountryStr(string(country)); !ok { - return fmt.Errorf("'%s' is not valid ISO-4217 country", country) - } - - return nil -} - -//IsSet indicates if Country is set -func (country Country) IsSet() bool { - return len(string(country)) > 0 -} - -//String implementation of Stringer interface -func (country Country) String() string { - return string(country) -} - -//Countries is a Country slice type -type Countries []Country - -//IsCountryIn Checks there is a country in Countries -func (countries Countries) IsCountryIn(country string) bool { - for _, c := range countries { - if string(c) == country { - return true - } - } - - return false -} - -//Currency represents a currency type from ISO-4217 -type Currency string - -//Value implementation of driver.Valuer -func (currency Currency) Value() (value driver.Value, err error) { - if currency == "" { - return "", nil - } - - if err = currency.Validate(); err != nil { - return nil, err - } - - return currency.String(), nil -} - -//UnmarshalJSON unmarshall implementation for Currency -func (currency *Currency) UnmarshalJSON(data []byte) error { - var str string - if err := json.Unmarshal(data, &str); err != nil { - return err - } - - currencyValue, err := ByCurrencyStrErr(str) - if err != nil { - return err - } - - *currency = currencyValue.Currency() - - return nil -} - -//Validate implementation of ozzo-validation Validate interface -func (currency Currency) Validate() error { - if _, ok := ByCurrencyStr(string(currency)); !ok { - return fmt.Errorf("'%s' is not valid ISO-4217 currency", currency) - } - - return nil -} - -//IsSet indicates if Currency is set -func (currency Currency) IsSet() bool { - return len(string(currency)) > 0 -} - -//String implementation of Stringer interface -func (currency Currency) String() string { - return string(currency) -} - -//Code represents a code type from ISO-4217 -type Code string - -//Value implementation of driver.Valuer -func (code Code) Value() (value driver.Value, err error) { - if code == "" { - return "", nil - } - - if err = code.Validate(); err != nil { - return nil, err - } - - return code.String(), nil -} - -//UnmarshalJSON unmarshall implementation for Code -func (code *Code) UnmarshalJSON(data []byte) error { - var str string - if err := json.Unmarshal(data, &str); err != nil { - return err - } - - currency, err := ByCodeStrErr(str) - if err != nil { - return err - } - - *code = currency.Code() - - return nil -} - -//Validate implementation of ozzo-validation Validate interface -func (code Code) Validate() error { - if _, ok := ByCodeStr(string(code)); !ok { - return fmt.Errorf("'%s' is not valid ISO-4217 code", code) - } - - return nil -} - -//IsSet indicates if Code is set -func (code Code) IsSet() bool { - return len(string(code)) > 0 -} - -//String implementation of Stringer interface -func (code Code) String() string { - return string(code) -} - -// Places returns number of digits after the dot. E.g. 2 for USD, 0 for for currencies which do not support fractions -func (code Code) Places() int { - return currenciesByCode[string(code)].decimalPlaces -} - -//Number represents a number type from ISO-4217 -type Number string - -//Value implementation of driver.Valuer -func (number Number) Value() (value driver.Value, err error) { - if number == "" { - return "", nil - } - - if err = number.Validate(); err != nil { - return nil, err - } - - return number.String(), nil -} - -//UnmarshalJSON unmarshall implementation for Number -func (number *Number) UnmarshalJSON(data []byte) error { - var str string - if err := json.Unmarshal(data, &str); err != nil { - return err - } - - currency, err := ByNumberStrErr(str) - if err != nil { - return err - } - - *number = currency.Number() - - return nil -} - -//Validate implementation of ozzo-validation Validate interface -func (number Number) Validate() error { - if _, ok := ByNumberStr(string(number)); !ok { - return fmt.Errorf("'%s' is not valid ISO-4217 number", number) - } - - return nil -} - -//IsSet indicates if Number is set -func (number Number) IsSet() bool { - return len(string(number)) > 0 -} - -//String implementation of Stringer interface -func (number Number) String() string { - return string(number) -} - type currency struct { countries Countries currency Currency @@ -248,9 +19,24 @@ type currency struct { decimalPlaces int } +// Currency returns Currency +func (c currency) Currency() Currency { return c.currency } + +// Code returns Code +func (c currency) Code() Code { return c.code } + +// Number returns Number +func (c currency) Number() Number { return c.number } + +// Countries returns Countries +func (c currency) Countries() Countries { return c.countries } + +// DecimalPlaces returns DecimalPlaces +func (c currency) DecimalPlaces() int { return c.decimalPlaces } + type currencies []currency -//CurrencyByCurrency get currency by currency +// CurrencyByCurrency get currency by currency func (currencies currencies) CurrencyByCurrency(curr string) (currency, bool) { for _, c := range currencies { if string(c.currency) == curr { @@ -261,7 +47,7 @@ func (currencies currencies) CurrencyByCurrency(curr string) (currency, bool) { return currency{}, false } -//CurrencyByCode gets currency by code +// CurrencyByCode gets currency by code func (currencies currencies) CurrencyByCode(code string) (currency, bool) { for _, c := range currencies { if string(c.code) == code { @@ -272,7 +58,7 @@ func (currencies currencies) CurrencyByCode(code string) (currency, bool) { return currency{}, false } -//CurrencyByNumber gets currency by number +// CurrencyByNumber gets currency by number func (currencies currencies) CurrencyByNumber(number string) (currency, bool) { for _, c := range currencies { if string(c.number) == number { @@ -283,43 +69,31 @@ func (currencies currencies) CurrencyByNumber(number string) (currency, bool) { return currency{}, false } -//Currency returns Currency -func (c currency) Currency() Currency { return c.currency } - -//Code returns Code -func (c currency) Code() Code { return c.code } - -//Number returns Number -func (c currency) Number() Number { return c.number } - -//Countries returns Countries -func (c currency) Countries() Countries { return c.countries } - -//ByCodeStr lookup for currency type by code +// ByCodeStr lookup for currency type by code func ByCodeStr(code string) (c currency, ok bool) { c, ok = currenciesByCode[code] return } -//ByCurrencyStr lookup for currency type by currency +// ByCurrencyStr lookup for currency type by currency func ByCurrencyStr(currency string) (c currency, ok bool) { c, ok = currenciesByCurrency[currency] return } -//ByNumberStr lookup for currency type by number +// ByNumberStr lookup for currency type by number func ByNumberStr(number string) (c currency, ok bool) { c, ok = currenciesByNumber[number] return } -//ByCountryStr lookup for currencies type by country +// ByCountryStr lookup for currencies type by country func ByCountryStr(country string) (c currencies, ok bool) { c, ok = currenciesByCountry[country] return } -//ByCodeStrErr lookup for currency type by code +// ByCodeStrErr lookup for currency type by code func ByCodeStrErr(code string) (c currency, err error) { var ok bool c, ok = currenciesByCode[code] @@ -331,7 +105,7 @@ func ByCodeStrErr(code string) (c currency, err error) { return } -//ByCurrencyStrErr lookup for currency type by currency +// ByCurrencyStrErr lookup for currency type by currency func ByCurrencyStrErr(currencyStr string) (c currency, err error) { var ok bool c, ok = currenciesByCurrency[currencyStr] @@ -343,7 +117,7 @@ func ByCurrencyStrErr(currencyStr string) (c currency, err error) { return } -//ByNumberStrErr lookup for currency type by number +// ByNumberStrErr lookup for currency type by number func ByNumberStrErr(number string) (c currency, err error) { var ok bool c, ok = currenciesByNumber[number] @@ -355,7 +129,7 @@ func ByNumberStrErr(number string) (c currency, err error) { return } -//ByCountryStrErr lookup for currencies type by country +// ByCountryStrErr lookup for currencies type by country func ByCountryStrErr(country string) (c currencies, err error) { var ok bool c, ok = currenciesByCountry[country] @@ -367,31 +141,31 @@ func ByCountryStrErr(country string) (c currencies, err error) { return } -//ByCode lookup for currency type by code +// ByCode lookup for currency type by code func ByCode(code Code) (c currency, ok bool) { c, ok = currenciesByCode[code.String()] return } -//ByCurrency lookup for currency type by currency +// ByCurrency lookup for currency type by currency func ByCurrency(currency Currency) (c currency, ok bool) { c, ok = currenciesByCurrency[currency.String()] return } -//ByNumber lookup for currency type by number +// ByNumber lookup for currency type by number func ByNumber(number Number) (c currency, ok bool) { c, ok = currenciesByNumber[number.String()] return } -//ByCountry lookup for currency type by country +// ByCountry lookup for currency type by country func ByCountry(country Country) (c currencies, ok bool) { c, ok = currenciesByCountry[country.String()] return } -//ByCodeErr lookup for currency type by code +// ByCodeErr lookup for currency type by code func ByCodeErr(code Code) (c currency, err error) { var ok bool c, ok = currenciesByCode[code.String()] @@ -403,7 +177,7 @@ func ByCodeErr(code Code) (c currency, err error) { return } -//ByCurrencyErr lookup for currencies type by code +// ByCurrencyErr lookup for currencies type by code func ByCurrencyErr(currencyStr Currency) (c currency, err error) { var ok bool c, ok = currenciesByCurrency[currencyStr.String()] @@ -415,7 +189,7 @@ func ByCurrencyErr(currencyStr Currency) (c currency, err error) { return } -//ByNumberErr lookup for currencies type by number +// ByNumberErr lookup for currencies type by number func ByNumberErr(number Number) (c currency, err error) { var ok bool c, ok = currenciesByNumber[number.String()] @@ -427,7 +201,7 @@ func ByNumberErr(number Number) (c currency, err error) { return } -//ByCountryErr lookup for currencies type by country +// ByCountryErr lookup for currencies type by country func ByCountryErr(country Country) (c currencies, err error) { var ok bool c, ok = currenciesByCountry[country.String()] diff --git a/currency/name.go b/currency/name.go new file mode 100644 index 0000000..0676f3d --- /dev/null +++ b/currency/name.go @@ -0,0 +1,59 @@ +package currency + +import ( + "database/sql/driver" + "encoding/json" + "fmt" +) + +// Currency represents a currency type from ISO-4217 +type Currency string + +// Value implementation of driver.Valuer +func (currency Currency) Value() (value driver.Value, err error) { + if currency == "" { + return "", nil + } + + if err = currency.Validate(); err != nil { + return nil, err + } + + return currency.String(), nil +} + +// UnmarshalJSON unmarshall implementation for Currency +func (currency *Currency) UnmarshalJSON(data []byte) error { + var str string + if err := json.Unmarshal(data, &str); err != nil { + return err + } + + currencyValue, err := ByCurrencyStrErr(str) + if err != nil { + return err + } + + *currency = currencyValue.Currency() + + return nil +} + +// Validate implementation of ozzo-validation Validate interface +func (currency Currency) Validate() error { + if _, ok := ByCurrencyStr(string(currency)); !ok { + return fmt.Errorf("'%s' is not valid ISO-4217 currency", currency) + } + + return nil +} + +// IsSet indicates if Currency is set +func (currency Currency) IsSet() bool { + return len(string(currency)) > 0 +} + +// String implementation of Stringer interface +func (currency Currency) String() string { + return string(currency) +} diff --git a/currency/number.go b/currency/number.go new file mode 100644 index 0000000..c969711 --- /dev/null +++ b/currency/number.go @@ -0,0 +1,59 @@ +package currency + +import ( + "database/sql/driver" + "encoding/json" + "fmt" +) + +// Number represents a number type from ISO-4217 +type Number string + +// Value implementation of driver.Valuer +func (number Number) Value() (value driver.Value, err error) { + if number == "" { + return "", nil + } + + if err = number.Validate(); err != nil { + return nil, err + } + + return number.String(), nil +} + +// UnmarshalJSON unmarshall implementation for Number +func (number *Number) UnmarshalJSON(data []byte) error { + var str string + if err := json.Unmarshal(data, &str); err != nil { + return err + } + + currency, err := ByNumberStrErr(str) + if err != nil { + return err + } + + *number = currency.Number() + + return nil +} + +// Validate implementation of ozzo-validation Validate interface +func (number Number) Validate() error { + if _, ok := ByNumberStr(string(number)); !ok { + return fmt.Errorf("'%s' is not valid ISO-4217 number", number) + } + + return nil +} + +// IsSet indicates if Number is set +func (number Number) IsSet() bool { + return len(string(number)) > 0 +} + +// String implementation of Stringer interface +func (number Number) String() string { + return string(number) +} diff --git a/email/email.go b/email/email.go index 7ed11dd..79c3f2b 100644 --- a/email/email.go +++ b/email/email.go @@ -16,10 +16,10 @@ import ( var regex = regexp.MustCompile(`(?m)^(((((((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?([A-Za-z0-9!#-'*+\/=?^_\x60{|}~-])+((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?)|(((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?"((\s? +)?(([!#-[\]-~])|(\\([ -~]|\s))))*(\s? +)?"))?)?(((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?<(((((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?(([A-Za-z0-9!#-'*+\/=?^_\x60{|}~-])+(\.([A-Za-z0-9!#-'*+\/=?^_\x60{|}~-])+)*)((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?)|(((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?"((\s? +)?(([!#-[\]-~])|(\\([ -~]|\s))))*(\s? +)?"))@((((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?(([A-Za-z0-9!#-'*+\/=?^_\x60{|}~-])+(\.([A-Za-z0-9!#-'*+\/=?^_\x60{|}~-])+)*)((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?)|(((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?\[((\s? +)?([!-Z^-~]))*(\s? +)?\]((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?)))>((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?))|(((((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?(([A-Za-z0-9!#-'*+\/=?^_\x60{|}~-])+(\.([A-Za-z0-9!#-'*+\/=?^_\x60{|}~-])+)*)((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?)|(((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?"((\s? +)?(([!#-[\]-~])|(\\([ -~]|\s))))*(\s? +)?"))@((((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?(([A-Za-z0-9!#-'*+\/=?^_\x60{|}~-])+(\.([A-Za-z0-9!#-'*+\/=?^_\x60{|}~-])+)*)((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?)|(((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?\[((\s? +)?([!-Z^-~]))*(\s? +)?\]((((\s? +)?(\(((\s? +)?(([!-'*-[\]-~]*)|(\\([ -~]|\s))))*(\s? +)?\)))(\s? +)?)|(\s? +))?))))$`) -//Email represents a email type +// Email represents a email type type Email string -//Value implementation of driver.Valuer +// Value implementation of driver.Valuer func (email Email) Value() (value driver.Value, err error) { if email == "" { return "", nil @@ -32,7 +32,7 @@ func (email Email) Value() (value driver.Value, err error) { return email.String(), nil } -//Validate implementation of ozzo-validation Validate interface +// Validate implementation of ozzo-validation Validate interface func (email Email) Validate() error { if len(email) < 4 || len(email) > 254 { return fmt.Errorf("'%s' is not valid email", email) @@ -52,7 +52,7 @@ func (email Email) Validate() error { return nil } -//UnmarshalJSON unmarshall implementation for Email +// UnmarshalJSON unmarshall implementation for Email func (email *Email) UnmarshalJSON(data []byte) error { var str string if err := json.Unmarshal(data, &str); err != nil { @@ -69,7 +69,7 @@ func (email *Email) UnmarshalJSON(data []byte) error { return nil } -//String implementation of Stringer interface +// String implementation of Stringer interface func (email Email) String() string { return string(email) } diff --git a/email/swagger.yaml b/email/swagger.yaml index d16348b..c687c37 100644 --- a/email/swagger.yaml +++ b/email/swagger.yaml @@ -5,4 +5,4 @@ components: example: user@example.com type: string format: email - x-go-type: github.com/mikekonan/go-types/email.Email + x-go-type: github.com/mikekonan/go-types/v2/email.Email diff --git a/go.mod b/go.mod index abb66e0..09ccf42 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/mikekonan/go-types +module github.com/mikekonan/go-types/v2 go 1.18 diff --git a/swagger.yaml b/swagger.yaml index a407d4c..2d9f909 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -4,7 +4,7 @@ components: CardDate: example: 01/06 type: string - x-go-type: github.com/mikekonan/go-types/card.CardDate + x-go-type: github.com/mikekonan/go-types/v2/card.CardDate CountryName: example: Austria type: string @@ -236,10 +236,10 @@ components: - Tonga - Trinidad and Tobago - Tunisia - - Turkey - Turkmenistan - Turks and Caicos Islands (the) - Tuvalu + - Türkiye - Uganda - Ukraine - United Arab Emirates (the) @@ -259,7 +259,7 @@ components: - Zambia - Zimbabwe - Åland Islands - x-go-type: github.com/mikekonan/go-types/country.Name + x-go-type: github.com/mikekonan/go-types/v2/country.Name CountryAlpha2: example: AS type: string @@ -493,10 +493,10 @@ components: - TO - TT - TN - - TR - TM - TC - TV + - TR - UG - UA - AE @@ -516,7 +516,7 @@ components: - ZM - ZW - AX - x-go-type: github.com/mikekonan/go-types/country.Alpha2Code + x-go-type: github.com/mikekonan/go-types/v2/country.Alpha2Code CountryAlpha3: example: USA type: string @@ -750,10 +750,10 @@ components: - TON - TTO - TUN - - TUR - TKM - TCA - TUV + - TUR - UGA - UKR - ARE @@ -773,7 +773,7 @@ components: - ZMB - ZWE - ALA - x-go-type: github.com/mikekonan/go-types/country.Alpha3Code + x-go-type: github.com/mikekonan/go-types/v2/country.Alpha3Code CurrencyCode: example: EUR type: string @@ -915,6 +915,7 @@ components: - RSD - SCR - SLL + - SLE - SGD - XSU - SBD @@ -951,7 +952,7 @@ components: - YER - ZMW - ZWL - x-go-type: github.com/mikekonan/go-types/currency.Code + x-go-type: github.com/mikekonan/go-types/v2/currency.Code CurrencyName: example: Euro type: string @@ -1125,7 +1126,7 @@ components: - Yemeni Rial - Zambian Kwacha - Zimbabwe Dollar - x-go-type: github.com/mikekonan/go-types/currency.Currency + x-go-type: github.com/mikekonan/go-types/v2/currency.Currency CurrencyCountry: example: PUERTO RICO type: string @@ -1380,7 +1381,7 @@ components: - YEMEN - ZAMBIA - ZIMBABWE - x-go-type: github.com/mikekonan/go-types/currency.Country + x-go-type: github.com/mikekonan/go-types/v2/currency.Country CurrencyNumber: example: "840" type: string @@ -1521,6 +1522,7 @@ components: - "941" - "690" - "694" + - "925" - "702" - "994" - "090" @@ -1561,629 +1563,30 @@ components: example: user@example.com type: string format: email - x-go-type: github.com/mikekonan/go-types/email.Email + x-go-type: github.com/mikekonan/go-types/v2/email.Email Date: example: 2006-01-02 type: string - x-go-type: github.com/mikekonan/go-types/time.Date - x-go-type-string-parse: github.com/mikekonan/go-types/time.ParseDateFromString + x-go-type: github.com/mikekonan/go-types/v2/time.Date + x-go-type-string-parse: github.com/mikekonan/go-types/v2/time.ParseDateFromString NullTime: example: 2020-12-08T16:38:09.70516Z type: string nullable: true - x-go-type: github.com/mikekonan/go-types/time.Time - x-go-type-string-parse: github.com/mikekonan/go-types/time.ParseNullTimeFromString - Timezone: - example: Europe/Minsk - type: string - format: rfc6557-time-zone - enum: - - Africa/Abidjan - - Africa/Accra - - Africa/Addis_Ababa - - Africa/Algiers - - Africa/Asmara - - Africa/Asmera - - Africa/Bamako - - Africa/Bangui - - Africa/Banjul - - Africa/Bissau - - Africa/Blantyre - - Africa/Brazzaville - - Africa/Bujumbura - - Africa/Cairo - - Africa/Casablanca - - Africa/Ceuta - - Africa/Conakry - - Africa/Dakar - - Africa/Dar_es_Salaam - - Africa/Djibouti - - Africa/Douala - - Africa/El_Aaiun - - Africa/Freetown - - Africa/Gaborone - - Africa/Harare - - Africa/Johannesburg - - Africa/Juba - - Africa/Kampala - - Africa/Khartoum - - Africa/Kigali - - Africa/Kinshasa - - Africa/Lagos - - Africa/Libreville - - Africa/Lome - - Africa/Luanda - - Africa/Lubumbashi - - Africa/Lusaka - - Africa/Malabo - - Africa/Maputo - - Africa/Maseru - - Africa/Mbabane - - Africa/Mogadishu - - Africa/Monrovia - - Africa/Nairobi - - Africa/Ndjamena - - Africa/Niamey - - Africa/Nouakchott - - Africa/Ouagadougou - - Africa/Porto-Novo - - Africa/Sao_Tome - - Africa/Timbuktu - - Africa/Tripoli - - Africa/Tunis - - Africa/Windhoek - - America/Adak - - America/Anchorage - - America/Anguilla - - America/Antigua - - America/Araguaina - - America/Argentina/Buenos_Aires - - America/Argentina/Catamarca - - America/Argentina/ComodRivadavia - - America/Argentina/Cordoba - - America/Argentina/Jujuy - - America/Argentina/La_Rioja - - America/Argentina/Mendoza - - America/Argentina/Rio_Gallegos - - America/Argentina/Salta - - America/Argentina/San_Juan - - America/Argentina/San_Luis - - America/Argentina/Tucuman - - America/Argentina/Ushuaia - - America/Aruba - - America/Asuncion - - America/Atikokan - - America/Atka - - America/Bahia - - America/Bahia_Banderas - - America/Barbados - - America/Belem - - America/Belize - - America/Blanc-Sablon - - America/Boa_Vista - - America/Bogota - - America/Boise - - America/Buenos_Aires - - America/Cambridge_Bay - - America/Campo_Grande - - America/Cancun - - America/Caracas - - America/Catamarca - - America/Cayenne - - America/Cayman - - America/Chicago - - America/Chihuahua - - America/Coral_Harbour - - America/Cordoba - - America/Costa_Rica - - America/Creston - - America/Cuiaba - - America/Curacao - - America/Danmarkshavn - - America/Dawson - - America/Dawson_Creek - - America/Denver - - America/Detroit - - America/Dominica - - America/Edmonton - - America/Eirunepe - - America/El_Salvador - - America/Ensenada - - America/Fort_Nelson - - America/Fort_Wayne - - America/Fortaleza - - America/Glace_Bay - - America/Godthab - - America/Goose_Bay - - America/Grand_Turk - - America/Grenada - - America/Guadeloupe - - America/Guatemala - - America/Guayaquil - - America/Guyana - - America/Halifax - - America/Havana - - America/Hermosillo - - America/Indiana/Indianapolis - - America/Indiana/Knox - - America/Indiana/Marengo - - America/Indiana/Petersburg - - America/Indiana/Tell_City - - America/Indiana/Vevay - - America/Indiana/Vincennes - - America/Indiana/Winamac - - America/Indianapolis - - America/Inuvik - - America/Iqaluit - - America/Jamaica - - America/Jujuy - - America/Juneau - - America/Kentucky/Louisville - - America/Kentucky/Monticello - - America/Knox_IN - - America/Kralendijk - - America/La_Paz - - America/Lima - - America/Los_Angeles - - America/Louisville - - America/Lower_Princes - - America/Maceio - - America/Managua - - America/Manaus - - America/Marigot - - America/Martinique - - America/Matamoros - - America/Mazatlan - - America/Mendoza - - America/Menominee - - America/Merida - - America/Metlakatla - - America/Mexico_City - - America/Miquelon - - America/Moncton - - America/Monterrey - - America/Montevideo - - America/Montreal - - America/Montserrat - - America/Nassau - - America/New_York - - America/Nipigon - - America/Nome - - America/Noronha - - America/North_Dakota/Beulah - - America/North_Dakota/Center - - America/North_Dakota/New_Salem - - America/Nuuk - - America/Ojinaga - - America/Panama - - America/Pangnirtung - - America/Paramaribo - - America/Phoenix - - America/Port-au-Prince - - America/Port_of_Spain - - America/Porto_Acre - - America/Porto_Velho - - America/Puerto_Rico - - America/Punta_Arenas - - America/Rainy_River - - America/Rankin_Inlet - - America/Recife - - America/Regina - - America/Resolute - - America/Rio_Branco - - America/Rosario - - America/Santa_Isabel - - America/Santarem - - America/Santiago - - America/Santo_Domingo - - America/Sao_Paulo - - America/Scoresbysund - - America/Shiprock - - America/Sitka - - America/St_Barthelemy - - America/St_Johns - - America/St_Kitts - - America/St_Lucia - - America/St_Thomas - - America/St_Vincent - - America/Swift_Current - - America/Tegucigalpa - - America/Thule - - America/Thunder_Bay - - America/Tijuana - - America/Toronto - - America/Tortola - - America/Vancouver - - America/Virgin - - America/Whitehorse - - America/Winnipeg - - America/Yakutat - - America/Yellowknife - - Antarctica/Casey - - Antarctica/Davis - - Antarctica/DumontDUrville - - Antarctica/Macquarie - - Antarctica/Mawson - - Antarctica/McMurdo - - Antarctica/Palmer - - Antarctica/Rothera - - Antarctica/South_Pole - - Antarctica/Syowa - - Antarctica/Troll - - Antarctica/Vostok - - Arctic/Longyearbyen - - Asia/Aden - - Asia/Almaty - - Asia/Amman - - Asia/Anadyr - - Asia/Aqtau - - Asia/Aqtobe - - Asia/Ashgabat - - Asia/Ashkhabad - - Asia/Atyrau - - Asia/Baghdad - - Asia/Bahrain - - Asia/Baku - - Asia/Bangkok - - Asia/Barnaul - - Asia/Beirut - - Asia/Bishkek - - Asia/Brunei - - Asia/Calcutta - - Asia/Chita - - Asia/Choibalsan - - Asia/Chongqing - - Asia/Chungking - - Asia/Colombo - - Asia/Dacca - - Asia/Damascus - - Asia/Dhaka - - Asia/Dili - - Asia/Dubai - - Asia/Dushanbe - - Asia/Famagusta - - Asia/Gaza - - Asia/Harbin - - Asia/Hebron - - Asia/Ho_Chi_Minh - - Asia/Hong_Kong - - Asia/Hovd - - Asia/Irkutsk - - Asia/Istanbul - - Asia/Jakarta - - Asia/Jayapura - - Asia/Jerusalem - - Asia/Kabul - - Asia/Kamchatka - - Asia/Karachi - - Asia/Kashgar - - Asia/Kathmandu - - Asia/Katmandu - - Asia/Khandyga - - Asia/Kolkata - - Asia/Krasnoyarsk - - Asia/Kuala_Lumpur - - Asia/Kuching - - Asia/Kuwait - - Asia/Macao - - Asia/Macau - - Asia/Magadan - - Asia/Makassar - - Asia/Manila - - Asia/Muscat - - Asia/Nicosia - - Asia/Novokuznetsk - - Asia/Novosibirsk - - Asia/Omsk - - Asia/Oral - - Asia/Phnom_Penh - - Asia/Pontianak - - Asia/Pyongyang - - Asia/Qatar - - Asia/Qostanay - - Asia/Qyzylorda - - Asia/Rangoon - - Asia/Riyadh - - Asia/Saigon - - Asia/Sakhalin - - Asia/Samarkand - - Asia/Seoul - - Asia/Shanghai - - Asia/Singapore - - Asia/Srednekolymsk - - Asia/Taipei - - Asia/Tashkent - - Asia/Tbilisi - - Asia/Tehran - - Asia/Tel_Aviv - - Asia/Thimbu - - Asia/Thimphu - - Asia/Tokyo - - Asia/Tomsk - - Asia/Ujung_Pandang - - Asia/Ulaanbaatar - - Asia/Ulan_Bator - - Asia/Urumqi - - Asia/Ust-Nera - - Asia/Vientiane - - Asia/Vladivostok - - Asia/Yakutsk - - Asia/Yangon - - Asia/Yekaterinburg - - Asia/Yerevan - - Atlantic/Azores - - Atlantic/Bermuda - - Atlantic/Canary - - Atlantic/Cape_Verde - - Atlantic/Faeroe - - Atlantic/Faroe - - Atlantic/Jan_Mayen - - Atlantic/Madeira - - Atlantic/Reykjavik - - Atlantic/South_Georgia - - Atlantic/St_Helena - - Atlantic/Stanley - - Australia/ACT - - Australia/Adelaide - - Australia/Brisbane - - Australia/Broken_Hill - - Australia/Canberra - - Australia/Currie - - Australia/Darwin - - Australia/Eucla - - Australia/Hobart - - Australia/LHI - - Australia/Lindeman - - Australia/Lord_Howe - - Australia/Melbourne - - Australia/NSW - - Australia/North - - Australia/Perth - - Australia/Queensland - - Australia/South - - Australia/Sydney - - Australia/Tasmania - - Australia/Victoria - - Australia/West - - Australia/Yancowinna - - Brazil/Acre - - Brazil/DeNoronha - - Brazil/East - - Brazil/West - - CET - - CST6CDT - - Canada/Atlantic - - Canada/Central - - Canada/Eastern - - Canada/Mountain - - Canada/Newfoundland - - Canada/Pacific - - Canada/Saskatchewan - - Canada/Yukon - - Chile/Continental - - Chile/EasterIsland - - Cuba - - EET - - EST - - EST5EDT - - Egypt - - Eire - - Etc/GMT - - Etc/GMT+0 - - Etc/GMT+1 - - Etc/GMT+10 - - Etc/GMT+11 - - Etc/GMT+12 - - Etc/GMT+2 - - Etc/GMT+3 - - Etc/GMT+4 - - Etc/GMT+5 - - Etc/GMT+6 - - Etc/GMT+7 - - Etc/GMT+8 - - Etc/GMT+9 - - Etc/GMT-0 - - Etc/GMT-1 - - Etc/GMT-10 - - Etc/GMT-11 - - Etc/GMT-12 - - Etc/GMT-13 - - Etc/GMT-14 - - Etc/GMT-2 - - Etc/GMT-3 - - Etc/GMT-4 - - Etc/GMT-5 - - Etc/GMT-6 - - Etc/GMT-7 - - Etc/GMT-8 - - Etc/GMT-9 - - Etc/GMT0 - - Etc/Greenwich - - Etc/UCT - - Etc/UTC - - Etc/Universal - - Etc/Zulu - - Europe/Amsterdam - - Europe/Andorra - - Europe/Astrakhan - - Europe/Athens - - Europe/Belfast - - Europe/Belgrade - - Europe/Berlin - - Europe/Bratislava - - Europe/Brussels - - Europe/Bucharest - - Europe/Budapest - - Europe/Busingen - - Europe/Chisinau - - Europe/Copenhagen - - Europe/Dublin - - Europe/Gibraltar - - Europe/Guernsey - - Europe/Helsinki - - Europe/Isle_of_Man - - Europe/Istanbul - - Europe/Jersey - - Europe/Kaliningrad - - Europe/Kiev - - Europe/Kirov - - Europe/Lisbon - - Europe/Ljubljana - - Europe/London - - Europe/Luxembourg - - Europe/Madrid - - Europe/Malta - - Europe/Mariehamn - - Europe/Minsk - - Europe/Monaco - - Europe/Moscow - - Europe/Nicosia - - Europe/Oslo - - Europe/Paris - - Europe/Podgorica - - Europe/Prague - - Europe/Riga - - Europe/Rome - - Europe/Samara - - Europe/San_Marino - - Europe/Sarajevo - - Europe/Saratov - - Europe/Simferopol - - Europe/Skopje - - Europe/Sofia - - Europe/Stockholm - - Europe/Tallinn - - Europe/Tirane - - Europe/Tiraspol - - Europe/Ulyanovsk - - Europe/Uzhgorod - - Europe/Vaduz - - Europe/Vatican - - Europe/Vienna - - Europe/Vilnius - - Europe/Volgograd - - Europe/Warsaw - - Europe/Zagreb - - Europe/Zaporozhye - - Europe/Zurich - - GB - - GB-Eire - - GMT - - GMT+0 - - GMT-0 - - GMT0 - - Greenwich - - HST - - Hongkong - - Iceland - - Indian/Antananarivo - - Indian/Chagos - - Indian/Christmas - - Indian/Cocos - - Indian/Comoro - - Indian/Kerguelen - - Indian/Mahe - - Indian/Maldives - - Indian/Mauritius - - Indian/Mayotte - - Indian/Reunion - - Iran - - Israel - - Jamaica - - Japan - - Kwajalein - - Libya - - MET - - MST - - MST7MDT - - Mexico/BajaNorte - - Mexico/BajaSur - - Mexico/General - - NZ - - NZ-CHAT - - Navajo - - PRC - - PST8PDT - - Pacific/Apia - - Pacific/Auckland - - Pacific/Bougainville - - Pacific/Chatham - - Pacific/Chuuk - - Pacific/Easter - - Pacific/Efate - - Pacific/Enderbury - - Pacific/Fakaofo - - Pacific/Fiji - - Pacific/Funafuti - - Pacific/Galapagos - - Pacific/Gambier - - Pacific/Guadalcanal - - Pacific/Guam - - Pacific/Honolulu - - Pacific/Johnston - - Pacific/Kiritimati - - Pacific/Kosrae - - Pacific/Kwajalein - - Pacific/Majuro - - Pacific/Marquesas - - Pacific/Midway - - Pacific/Nauru - - Pacific/Niue - - Pacific/Norfolk - - Pacific/Noumea - - Pacific/Pago_Pago - - Pacific/Palau - - Pacific/Pitcairn - - Pacific/Pohnpei - - Pacific/Ponape - - Pacific/Port_Moresby - - Pacific/Rarotonga - - Pacific/Saipan - - Pacific/Samoa - - Pacific/Tahiti - - Pacific/Tarawa - - Pacific/Tongatapu - - Pacific/Truk - - Pacific/Wake - - Pacific/Wallis - - Pacific/Yap - - Poland - - Portugal - - ROC - - ROK - - Singapore - - Turkey - - UCT - - US/Alaska - - US/Aleutian - - US/Arizona - - US/Central - - US/East-Indiana - - US/Eastern - - US/Hawaii - - US/Indiana-Starke - - US/Michigan - - US/Mountain - - US/Pacific - - US/Samoa - - UTC - - Universal - - W-SU - - WET - - Zulu - x-go-type: github.com/mikekonan/go-types/timezone.Timezone + x-go-type: github.com/mikekonan/go-types/v2/time.Time + x-go-type-string-parse: github.com/mikekonan/go-types/v2/time.ParseNullTimeFromString URL: example: (ftp|http(s)|mail...)://google.com type: string format: uri - x-go-type: github.com/mikekonan/go-types/url.URL + x-go-type: github.com/mikekonan/go-types/v2/url.URL HttpURL: example: http(s)://google.com type: string format: uri - x-go-type: github.com/mikekonan/go-types/url.HttpURL + x-go-type: github.com/mikekonan/go-types/v2/url.HttpURL NullHttpURL: example: http(s)://google.com type: string format: uri - x-go-type: github.com/mikekonan/go-types/url.NullHttpURL + x-go-type: github.com/mikekonan/go-types/v2/url.NullHttpURL diff --git a/time/swagger.yaml b/time/swagger.yaml index f4a4dfd..27e3f93 100644 --- a/time/swagger.yaml +++ b/time/swagger.yaml @@ -4,11 +4,11 @@ components: Date: example: 2006-01-02 type: string - x-go-type: github.com/mikekonan/go-types/time.Date - x-go-type-string-parse: github.com/mikekonan/go-types/time.ParseDateFromString + x-go-type: github.com/mikekonan/go-types/v2/time.Date + x-go-type-string-parse: github.com/mikekonan/go-types/v2/time.ParseDateFromString NullTime: example: 2020-12-08T16:38:09.70516Z type: string nullable: true - x-go-type: github.com/mikekonan/go-types/time.Time - x-go-type-string-parse: github.com/mikekonan/go-types/time.ParseNullTimeFromString + x-go-type: github.com/mikekonan/go-types/v2/time.Time + x-go-type-string-parse: github.com/mikekonan/go-types/v2/time.ParseNullTimeFromString diff --git a/timezone/.generator/generator.js b/timezone/.generator/generator.js index cdeace9..2b0918e 100644 --- a/timezone/.generator/generator.js +++ b/timezone/.generator/generator.js @@ -29,7 +29,7 @@ const spec = { type: "string", format: "rfc6557-time-zone", enum: [...new Set(names)], - "x-go-type": "github.com/mikekonan/go-types/timezone.Timezone", + "x-go-type": "github.com/mikekonan/go-types/v2/timezone.Timezone", }, }, }, diff --git a/timezone/timezone.go b/timezone/timezone.go index 5c0fbf2..51945d8 100644 --- a/timezone/timezone.go +++ b/timezone/timezone.go @@ -8,7 +8,7 @@ import ( type Timezone string -//UnmarshalJSON unmarshall implementation for timezone +// UnmarshalJSON unmarshall implementation for timezone func (name *Timezone) UnmarshalJSON(data []byte) error { var str string if err := json.Unmarshal(data, &str); err != nil { @@ -23,7 +23,7 @@ func (name *Timezone) UnmarshalJSON(data []byte) error { return nil } -//Value implementation of driver.Valuer +// Value implementation of driver.Valuer func (name Timezone) Value() (value driver.Value, err error) { if name == "" { return "", nil @@ -36,25 +36,25 @@ func (name Timezone) Value() (value driver.Value, err error) { return name.String(), nil } -//Validate implementation of ozzo-validation Validate interface +// Validate implementation of ozzo-validation Validate interface func (name Timezone) Validate() (err error) { _, err = ByNameStrErr(string(name)) return } -//String implementation of Stringer interface +// String implementation of Stringer interface func (name Timezone) String() string { return string(name) } -//ByNameStr lookup for timezone by name string +// ByNameStr lookup for timezone by name string func ByNameStr(timezoneStr string) (result Timezone, ok bool) { result, ok = timezonesByName[timezoneStr] return } -//ByNameStrErr lookup for timezone by name with error return type +// ByNameStrErr lookup for timezone by name with error return type func ByNameStrErr(timezoneStr string) (result Timezone, err error) { var ok bool result, ok = ByNameStr(timezoneStr) diff --git a/url/swagger.yaml b/url/swagger.yaml index b9f4b4f..500d5e2 100644 --- a/url/swagger.yaml +++ b/url/swagger.yaml @@ -5,14 +5,14 @@ components: example: (ftp|http(s)|mail...)://google.com type: string format: uri - x-go-type: github.com/mikekonan/go-types/url.URL + x-go-type: github.com/mikekonan/go-types/v2/url.URL HttpURL: example: http(s)://google.com type: string format: uri - x-go-type: github.com/mikekonan/go-types/url.HttpURL + x-go-type: github.com/mikekonan/go-types/v2/url.HttpURL NullHttpURL: example: http(s)://google.com type: string format: uri - x-go-type: github.com/mikekonan/go-types/url.NullHttpURL + x-go-type: github.com/mikekonan/go-types/v2/url.NullHttpURL diff --git a/url/url.go b/url/url.go index 1b378fb..a3ec6b7 100644 --- a/url/url.go +++ b/url/url.go @@ -17,7 +17,7 @@ import ( // URL represents a URL type type URL string -//Value implementation of driver.Valuer +// Value implementation of driver.Valuer func (url URL) Value() (value driver.Value, err error) { if url == "" { return "", nil @@ -30,7 +30,7 @@ func (url URL) Value() (value driver.Value, err error) { return url.String(), nil } -//Validate implementation of ozzo-validation Validate interface +// Validate implementation of ozzo-validation Validate interface func (url URL) Validate() error { if !govalidator.IsURL(url.String()) { return fmt.Errorf("'%s' is not a valid url", url) @@ -39,7 +39,7 @@ func (url URL) Validate() error { return nil } -//UnmarshalJSON unmarshall implementation for Email +// UnmarshalJSON unmarshall implementation for Email func (url *URL) UnmarshalJSON(data []byte) error { var str string if err := json.Unmarshal(data, &str); err != nil { @@ -56,7 +56,7 @@ func (url *URL) UnmarshalJSON(data []byte) error { return nil } -//String implementation of Stringer interface +// String implementation of Stringer interface func (url URL) String() string { return string(url) } @@ -64,7 +64,7 @@ func (url URL) String() string { // HttpURL represents a URL type with http/https schema type HttpURL string -//Value implementation of driver.Valuer +// Value implementation of driver.Valuer func (httpUrl HttpURL) Value() (value driver.Value, err error) { if httpUrl == "" { return "", nil @@ -77,7 +77,7 @@ func (httpUrl HttpURL) Value() (value driver.Value, err error) { return httpUrl.String(), nil } -//Validate implementation of ozzo-validation Validate interface +// Validate implementation of ozzo-validation Validate interface func (httpUrl HttpURL) Validate() (err error) { if len(httpUrl) == 0 { return fmt.Errorf("'%s' is not a valid http url", httpUrl) @@ -90,7 +90,7 @@ func (httpUrl HttpURL) Validate() (err error) { return URL(httpUrl).Validate() } -//UnmarshalJSON unmarshall implementation for Email +// UnmarshalJSON unmarshall implementation for Email func (httpUrl *HttpURL) UnmarshalJSON(data []byte) error { var url string if err := json.Unmarshal(data, &url); err != nil { @@ -107,7 +107,7 @@ func (httpUrl *HttpURL) UnmarshalJSON(data []byte) error { return nil } -//String implementation of Stringer interface +// String implementation of Stringer interface func (httpUrl HttpURL) String() string { return string(httpUrl) } @@ -116,7 +116,7 @@ func (httpUrl HttpURL) String() string { // Can be empty type NullHttpURL string -//Value implementation of driver.Valuer +// Value implementation of driver.Valuer func (nullHttpURL NullHttpURL) Value() (value driver.Value, err error) { if nullHttpURL == "" { return "", nil @@ -129,7 +129,7 @@ func (nullHttpURL NullHttpURL) Value() (value driver.Value, err error) { return nullHttpURL.String(), nil } -//Validate implementation of ozzo-validation Validate interface +// Validate implementation of ozzo-validation Validate interface func (nullHttpURL NullHttpURL) Validate() (err error) { if len(nullHttpURL) == 0 { return nil @@ -142,7 +142,7 @@ func (nullHttpURL NullHttpURL) Validate() (err error) { return URL(nullHttpURL).Validate() } -//UnmarshalJSON unmarshall implementation for Email +// UnmarshalJSON unmarshall implementation for Email func (nullHttpURL *NullHttpURL) UnmarshalJSON(data []byte) error { var url string if err := json.Unmarshal(data, &url); err != nil { @@ -159,7 +159,7 @@ func (nullHttpURL *NullHttpURL) UnmarshalJSON(data []byte) error { return nil } -//String implementation of Stringer interface +// String implementation of Stringer interface func (nullHttpURL NullHttpURL) String() string { return string(nullHttpURL) }