-
-
Notifications
You must be signed in to change notification settings - Fork 75
/
capitals.go
1859 lines (1844 loc) · 31.2 KB
/
capitals.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package countries
import (
"encoding/json"
"fmt"
)
// CapitalCode - capital code
type CapitalCode int64 // int64 for database/sql/driver.Valuer compatibility
// Capital - capital info
type Capital struct {
Name string
Code CapitalCode
Country CountryCode
}
// Type implements Typer interface
func (_ CapitalCode) Type() string {
return TypeCapitalCode
}
// String - implements fmt.Stringer, returns a english name the capital of country
//nolint:gocyclo
func (c CapitalCode) String() string { //nolint:gocyclo
switch c {
case CapitalAU:
return "Canberra"
case CapitalAT:
return "Vienna"
case CapitalAZ:
return "Baku"
case CapitalAL:
return "Tirana"
case CapitalDZ:
return "Algiers"
case CapitalAS:
return "Pago Pago"
case CapitalAI:
return "The Valley"
case CapitalAO:
return "Luanda"
case CapitalAD:
return "Andorra la Vella"
case CapitalAQ:
return "None"
case CapitalAG:
return "St. John's"
case CapitalAN:
return "Willemstad"
case CapitalAE:
return "Abu Dhabi"
case CapitalAR:
return "Buenos Aires"
case CapitalAM:
return "Yerevan"
case CapitalAW:
return "Oranjestad"
case CapitalAF:
return "Kabul"
case CapitalBS:
return "Nassau"
case CapitalBD:
return "Dhaka"
case CapitalBB:
return "Bridgetown"
case CapitalBH:
return "Manama"
case CapitalBY:
return "Minsk"
case CapitalBZ:
return "Belmopan"
case CapitalBE:
return "Brussels"
case CapitalBJ:
return "Porto-Novo"
case CapitalBM:
return "Hamilton"
case CapitalBG:
return "Sofia"
case CapitalBO:
return "Sucre"
case CapitalBA:
return "Sarajevo"
case CapitalBW:
return "Gaborone"
case CapitalBR:
return "Brasilia"
case CapitalIO:
return "Diego Garcia"
case CapitalBN:
return "Bandar Seri Begawan"
case CapitalBF:
return "Ouagadougou"
case CapitalBI:
return "Bujumbura"
case CapitalBT:
return "Thimphu"
case CapitalVU:
return "Port Vila"
case CapitalVA:
return "Vatican City"
case CapitalGB:
return "London"
case CapitalHU:
return "Budapest"
case CapitalVE:
return "Caracas"
case CapitalVG:
return "Road Town"
case CapitalVI:
return "Charlotte Amalie"
case CapitalTL:
return "Dili"
case CapitalVN:
return "Hanoi"
case CapitalGA:
return "Libreville"
case CapitalHT:
return "Port-au-Prince"
case CapitalGY:
return "Georgetown Guyana"
case CapitalGM:
return "Banjul"
case CapitalGH:
return "Accra"
case CapitalGP:
return "Basse-Terre Guadeloupe"
case CapitalGT:
return "Guatemala City"
case CapitalGN:
return "Conakry"
case CapitalGW:
return "Bissau"
case CapitalDE:
return "Berlin"
case CapitalGI:
return "Gibraltar"
case CapitalHN:
return "Tegucigalpa"
case CapitalHK:
return "Hong Kong"
case CapitalGD:
return "St. George's"
case CapitalGL:
return "Nuuk"
case CapitalGR:
return "Athens"
case CapitalGE:
return "Tbilisi"
case CapitalGU:
return "Hagatna"
case CapitalDK:
return "Copenhagen"
case CapitalCD:
return "Kinshasa"
case CapitalDJ:
return "Djibouti"
case CapitalDM:
return "Roseau"
case CapitalDO:
return "Santo Domingo"
case CapitalEG:
return "Cairo"
case CapitalZM:
return "Lusaka"
case CapitalEH:
return "El-Aaiun"
case CapitalZW:
return "Harare"
case CapitalIL:
return "Jerusalem"
case CapitalIN:
return "New Delhi"
case CapitalID:
return "Jakarta"
case CapitalJO:
return "Amman"
case CapitalIQ:
return "Baghdad"
case CapitalIR:
return "Tehran"
case CapitalIE:
return "Dublin"
case CapitalIS:
return "Reykjavik"
case CapitalES:
return "Madrid"
case CapitalIT:
return "Rome"
case CapitalYE:
return "Sanaa"
case CapitalKZ:
return "Nur-Sultan"
case CapitalKY:
return "George Town"
case CapitalKH:
return "Phnom Penh"
case CapitalCM:
return "Yaounde"
case CapitalCA:
return "Ottawa"
case CapitalQA:
return "Doha"
case CapitalKE:
return "Nairobi"
case CapitalCY:
return "Nicosia"
case CapitalKI:
return "Tarawa"
case CapitalCN:
return "Beijing"
case CapitalCC:
return "West Island"
case CapitalCO:
return "Bogota"
case CapitalKM:
return "Moroni"
case CapitalCG:
return "Brazzaville"
case CapitalKP:
return "Pyongyang"
case CapitalKR:
return "Seoul"
case CapitalCR:
return "San Jose"
case CapitalCI:
return "Yamoussoukro"
case CapitalCU:
return "Havana"
case CapitalKW:
return "Kuwait City"
case CapitalKG:
return "Bishkek"
case CapitalLA:
return "Vientiane"
case CapitalLV:
return "Riga"
case CapitalLS:
return "Maseru"
case CapitalLR:
return "Monrovia"
case CapitalLB:
return "Beirut"
case CapitalLY:
return "Tripoli"
case CapitalLT:
return "Vilnius"
case CapitalLI:
return "Vaduz"
case CapitalLU:
return "Luxembourg"
case CapitalMU:
return "Port Louis"
case CapitalMR:
return "Nouakchott"
case CapitalMG:
return "Antananarivo"
case CapitalYT:
return "Mamoudzou"
case CapitalMO:
return "Macao"
case CapitalMK:
return "Skopje"
case CapitalMW:
return "Lilongwe"
case CapitalMY:
return "Kuala Lumpur"
case CapitalML:
return "Bamako"
case CapitalMV:
return "Male"
case CapitalMT:
return "Valletta"
case CapitalMP:
return "Saipan"
case CapitalMA:
return "Rabat"
case CapitalMQ:
return "Fort-de-France"
case CapitalMH:
return "Majuro"
case CapitalMX:
return "Mexico City"
case CapitalFM:
return "Palikir"
case CapitalMZ:
return "Maputo"
case CapitalMD:
return "Chisinau"
case CapitalMC:
return "Monaco"
case CapitalMN:
return "Ulaanbaatar"
case CapitalMS:
return "Plymouth"
case CapitalMM:
return "Nay Pyi Taw"
case CapitalNA:
return "Windhoek"
case CapitalNR:
return "Yaren"
case CapitalNP:
return "Kathmandu"
case CapitalNE:
return "Niamey"
case CapitalNG:
return "Abuja"
case CapitalNL:
return "Amsterdam"
case CapitalNI:
return "Managua"
case CapitalNU:
return "Alofi"
case CapitalNZ:
return "Wellington"
case CapitalNC:
return "Noumea"
case CapitalNO:
return "Oslo"
case CapitalOM:
return "Muscat"
case CapitalBV:
return "None"
case CapitalIM:
return "Douglas"
case CapitalNF:
return "Kingston Norfolk Island"
case CapitalPN:
return "Adamstown"
case CapitalCX:
return "Flying Fish Cove"
case CapitalSH:
return "Jamestown"
case CapitalWF:
return "Mata Utu"
case CapitalHM:
return "None"
case CapitalCV:
return "Praia"
case CapitalCK:
return "Avarua"
case CapitalWS:
return "Apia"
case CapitalSJ:
return "Longyearbyen"
case CapitalTC:
return "Cockburn Town"
case CapitalUM:
return "None"
case CapitalPK:
return "Islamabad"
case CapitalPW:
return "Melekeok"
case CapitalPS:
return "East Jerusalem"
case CapitalPA:
return "Panama City"
case CapitalPG:
return "Port Moresby"
case CapitalPY:
return "Asuncion"
case CapitalPE:
return "Lima"
case CapitalPL:
return "Warsaw"
case CapitalPT:
return "Lisbon"
case CapitalPR:
return "San Juan"
case CapitalRE:
return "Saint-Denis"
case CapitalRU:
return "Moscow"
case CapitalRW:
return "Kigali"
case CapitalRO:
return "Bucharest"
case CapitalSV:
return "San Salvador"
case CapitalSM:
return "San Marino"
case CapitalST:
return "Sao Tome"
case CapitalSA:
return "Riyadh"
case CapitalSZ:
return "Mbabane"
case CapitalSC:
return "Victoria"
case CapitalSN:
return "Dakar"
case CapitalPM:
return "Saint-Pierre"
case CapitalVC:
return "Kingstown"
case CapitalKN:
return "Basseterre"
case CapitalLC:
return "Castries"
case CapitalSG:
return "Singapore"
case CapitalSY:
return "Damascus"
case CapitalSK:
return "Bratislava"
case CapitalSI:
return "Ljubljana"
case CapitalUS:
return "Washington"
case CapitalSB:
return "Honiara"
case CapitalSO:
return "Mogadishu"
case CapitalSD:
return "Khartoum"
case CapitalSR:
return "Paramaribo"
case CapitalSL:
return "Freetown"
case CapitalTJ:
return "Dushanbe"
case CapitalTW:
return "Taipei"
case CapitalTH:
return "Bangkok"
case CapitalTZ:
return "Dodoma"
case CapitalTG:
return "Lome"
case CapitalTK:
return "None"
case CapitalTO:
return "Nuku'alofa"
case CapitalTT:
return "Port of Spain"
case CapitalTV:
return "Funafuti"
case CapitalTN:
return "Tunis"
case CapitalTM:
return "Ashgabat"
case CapitalTR:
return "Ankara"
case CapitalUG:
return "Kampala"
case CapitalUZ:
return "Tashkent"
case CapitalUA:
return "Kyiv"
case CapitalUY:
return "Montevideo"
case CapitalFO:
return "Torshavn"
case CapitalFJ:
return "Suva"
case CapitalPH:
return "Manila"
case CapitalFI:
return "Helsinki"
case CapitalFK:
return "Stanley"
case CapitalFR:
return "Paris"
case CapitalGF:
return "Cayenne"
case CapitalPF:
return "Papeete"
case CapitalTF:
return "Port-aux-Francais"
case CapitalHR:
return "Zagreb"
case CapitalCF:
return "Bangui"
case CapitalTD:
return "N'Djamena"
case CapitalCZ:
return "Prague"
case CapitalCL:
return "Santiago"
case CapitalCH:
return "Bern"
case CapitalSE:
return "Stockholm"
case CapitalLK:
return "Colombo"
case CapitalEC:
return "Quito"
case CapitalGQ:
return "Malabo"
case CapitalER:
return "Asmara"
case CapitalEE:
return "Tallinn"
case CapitalET:
return "Addis Ababa"
case CapitalZA:
return "Pretoria"
case CapitalGS:
return "Grytviken"
case CapitalJM:
return "Kingston"
case CapitalME:
return "Podgorica"
case CapitalBL:
return "Gustavia"
case CapitalSX:
return "Philipsburg"
case CapitalRS, CapitalYU:
return "Belgrade"
case CapitalAX:
return "Mariehamn"
case CapitalBQ:
return "None"
case CapitalGG:
return "St Peter Port"
case CapitalJE:
return "Saint Helier"
case CapitalCW:
return "Willemstad Curacao"
case CapitalMF:
return "Marigot"
case CapitalSS:
return "Juba"
case CapitalXK:
return "Pristina"
case CapitalJP:
return "Tokyo"
case CapitalXX:
return "None"
}
return UnknownMsg
}
// Country - returns a country of capital
//nolint:gocyclo
func (c CapitalCode) Country() CountryCode { //nolint:gocyclo
switch c {
case CapitalAU:
return AU
case CapitalAT:
return AT
case CapitalAZ:
return AZ
case CapitalAL:
return AL
case CapitalDZ:
return DZ
case CapitalAS:
return AS
case CapitalAI:
return AI
case CapitalAO:
return AO
case CapitalAD:
return AD
case CapitalAQ:
return AQ
case CapitalAG:
return AG
case CapitalAN:
return AN
case CapitalAE:
return AE
case CapitalAR:
return AR
case CapitalAM:
return AM
case CapitalAW:
return AW
case CapitalAF:
return AF
case CapitalBS:
return BS
case CapitalBD:
return BD
case CapitalBB:
return BB
case CapitalBH:
return BH
case CapitalBY:
return BY
case CapitalBZ:
return BZ
case CapitalBE:
return BE
case CapitalBJ:
return BJ
case CapitalBM:
return BM
case CapitalBG:
return BG
case CapitalBO:
return BO
case CapitalBA:
return BA
case CapitalBW:
return BW
case CapitalBR:
return BR
case CapitalIO:
return IO
case CapitalBN:
return BN
case CapitalBF:
return BF
case CapitalBI:
return BI
case CapitalBT:
return BT
case CapitalVU:
return VU
case CapitalVA:
return VA
case CapitalGB:
return GB
case CapitalHU:
return HU
case CapitalVE:
return VE
case CapitalVG:
return VG
case CapitalVI:
return VI
case CapitalTL:
return TL
case CapitalVN:
return VN
case CapitalGA:
return GA
case CapitalHT:
return HT
case CapitalGY:
return GY
case CapitalGM:
return GM
case CapitalGH:
return GH
case CapitalGP:
return GP
case CapitalGT:
return GT
case CapitalGN:
return GN
case CapitalGW:
return GW
case CapitalDE:
return DE
case CapitalGI:
return GI
case CapitalHN:
return HN
case CapitalHK:
return HK
case CapitalGD:
return GD
case CapitalGL:
return GL
case CapitalGR:
return GR
case CapitalGE:
return GE
case CapitalGU:
return GU
case CapitalDK:
return DK
case CapitalCD:
return CD
case CapitalDJ:
return DJ
case CapitalDM:
return DM
case CapitalDO:
return DO
case CapitalEG:
return EG
case CapitalZM:
return ZM
case CapitalEH:
return EH
case CapitalZW:
return ZW
case CapitalIL:
return IL
case CapitalIN:
return IN
case CapitalID:
return ID
case CapitalJO:
return JO
case CapitalIQ:
return IQ
case CapitalIR:
return IR
case CapitalIE:
return IE
case CapitalIS:
return IS
case CapitalES:
return ES
case CapitalIT:
return IT
case CapitalYE:
return YE
case CapitalKZ:
return KZ
case CapitalKY:
return KY
case CapitalKH:
return KH
case CapitalCM:
return CM
case CapitalCA:
return CA
case CapitalQA:
return QA
case CapitalKE:
return KE
case CapitalCY:
return CY
case CapitalKI:
return KI
case CapitalCN:
return CN
case CapitalCC:
return CC
case CapitalCO:
return CO
case CapitalKM:
return KM
case CapitalCG:
return CG
case CapitalKP:
return KP
case CapitalKR:
return KR
case CapitalCR:
return CR
case CapitalCI:
return CI
case CapitalCU:
return CU
case CapitalKW:
return KW
case CapitalKG:
return KG
case CapitalLA:
return LA
case CapitalLV:
return LV
case CapitalLS:
return LS
case CapitalLR:
return LR
case CapitalLB:
return LB
case CapitalLY:
return LY
case CapitalLT:
return LT
case CapitalLI:
return LI
case CapitalLU:
return LU
case CapitalMU:
return MU
case CapitalMR:
return MR
case CapitalMG:
return MG
case CapitalYT:
return YT
case CapitalMO:
return MO
case CapitalMK:
return MK
case CapitalMW:
return MW
case CapitalMY:
return MY
case CapitalML:
return ML
case CapitalMV:
return MV
case CapitalMT:
return MT
case CapitalMP:
return MP
case CapitalMA:
return MA
case CapitalMQ:
return MQ
case CapitalMH:
return MH
case CapitalMX:
return MX
case CapitalFM:
return FM
case CapitalMZ:
return MZ
case CapitalMD:
return MD
case CapitalMC:
return MC
case CapitalMN:
return MN
case CapitalMS:
return MS
case CapitalMM:
return MM
case CapitalNA:
return NA
case CapitalNR:
return NR
case CapitalNP:
return NP
case CapitalNE:
return NE
case CapitalNG:
return NG
case CapitalNL:
return NL
case CapitalNI:
return NI
case CapitalNU:
return NU
case CapitalNZ:
return NZ
case CapitalNC:
return NC
case CapitalNO:
return NO
case CapitalOM:
return OM
case CapitalBV:
return BV
case CapitalIM:
return IM
case CapitalNF:
return NF
case CapitalPN:
return PN
case CapitalCX:
return CX
case CapitalSH:
return SH
case CapitalWF:
return WF
case CapitalHM:
return HM
case CapitalCV:
return CV
case CapitalCK:
return CK
case CapitalWS:
return WS
case CapitalSJ:
return SJ
case CapitalTC:
return TC
case CapitalUM:
return UM
case CapitalPK:
return PK
case CapitalPW:
return PW
case CapitalPS:
return PS
case CapitalPA:
return PA
case CapitalPG:
return PG
case CapitalPY:
return PY
case CapitalPE:
return PE
case CapitalPL:
return PL
case CapitalPT:
return PT
case CapitalPR:
return PR
case CapitalRE:
return RE
case CapitalRU:
return RU
case CapitalRW:
return RW
case CapitalRO:
return RO
case CapitalSV:
return SV
case CapitalSM:
return SM
case CapitalST:
return ST
case CapitalSA:
return SA
case CapitalSZ:
return SZ
case CapitalSC:
return SC
case CapitalSN:
return SN
case CapitalPM:
return PM
case CapitalVC:
return VC
case CapitalKN:
return KN
case CapitalLC:
return LC
case CapitalSG:
return SG
case CapitalSY:
return SY
case CapitalSK:
return SK
case CapitalSI:
return SI
case CapitalUS:
return US
case CapitalSB:
return SB
case CapitalSO:
return SO
case CapitalSD:
return SD
case CapitalSR:
return SR
case CapitalSL:
return SL
case CapitalTJ:
return TJ
case CapitalTW:
return TW
case CapitalTH:
return TH
case CapitalTZ:
return TZ
case CapitalTG:
return TG
case CapitalTK:
return TK
case CapitalTO:
return TO
case CapitalTT:
return TT
case CapitalTV:
return TV
case CapitalTN:
return TN
case CapitalTM:
return TM
case CapitalTR:
return TR
case CapitalUG:
return UG
case CapitalUZ:
return UZ
case CapitalUA:
return UA
case CapitalUY:
return UY
case CapitalFO:
return FO
case CapitalFJ:
return FJ
case CapitalPH:
return PH
case CapitalFI:
return FI
case CapitalFK:
return FK
case CapitalFR:
return FR
case CapitalGF:
return GF
case CapitalPF:
return PF
case CapitalTF:
return TF
case CapitalHR:
return HR
case CapitalCF:
return CF
case CapitalTD:
return TD
case CapitalCZ:
return CZ
case CapitalCL:
return CL
case CapitalCH:
return CH
case CapitalSE:
return SE
case CapitalLK:
return LK
case CapitalEC:
return EC