-
Notifications
You must be signed in to change notification settings - Fork 0
/
shorthand.go
133 lines (129 loc) · 3.76 KB
/
shorthand.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
package usps
var shortToLong = map[string]string{
"AL": "ALABAMA",
"AK": "ALASKA",
"AS": "AMERICAN SAMOA",
"AZ": "ARIZONA",
"AR": "ARKANSAS",
"CA": "CALIFORNIA",
"CO": "COLORADO",
"CT": "CONNECTICUT",
"DE": "DELAWARE",
"DC": "DISTRICT OF COLUMBIA",
"FM": "FEDERATED STATES OF MICRONESIA",
"FL": "FLORIDA",
"GA": "GEORGIA",
"GU": "GUAM",
"HI": "HAWAII",
"ID": "IDAHO",
"IL": "ILLINOIS",
"IN": "INDIANA",
"IA": "IOWA",
"KS": "KANSAS",
"KY": "KENTUCKY",
"LA": "LOUISIANA",
"ME": "MAINE",
"MH": "MARSHALL ISLANDS",
"MD": "MARYLAND",
"MA": "MASSACHUSETTS",
"MI": "MICHIGAN",
"MN": "MINNESOTA",
"MS": "MISSISSIPPI",
"MO": "MISSOURI",
"MT": "MONTANA",
"NE": "NEBRASKA",
"NV": "NEVADA",
"NH": "NEW HAMPSHIRE",
"NJ": "NEW JERSEY",
"NM": "NEW MEXICO",
"NY": "NEW YORK",
"NC": "NORTH CAROLINA",
"ND": "NORTH DAKOTA",
"MP": "NORTHERN MARIANA ISLANDS",
"OH": "OHIO",
"OK": "OKLAHOMA",
"OR": "OREGON",
"PW": "PALAU",
"PA": "PENNSYLVANIA",
"PR": "PUERTO RICO",
"RI": "RHODE ISLAND",
"SC": "SOUTH CAROLINA",
"SD": "SOUTH DAKOTA",
"TN": "TENNESSEE",
"TX": "TEXAS",
"UT": "UTAH",
"VT": "VERMONT",
"VI": "VIRGIN ISLANDS",
"VA": "VIRGINIA",
"WA": "WASHINGTON",
"WV": "WEST VIRGINIA",
"WI": "WISCONSIN",
"WY": "WYOMING",
}
var longToShort = map[string]string{
"ALABAMA": "AL",
"ALASKA": "AK",
"AMERICAN SAMOA": "AS",
"ARIZONA": "AZ",
"ARKANSAS": "AR",
"CALIFORNIA": "CA",
"COLORADO": "CO",
"CONNECTICUT": "CT",
"DELAWARE": "DE",
"DISTRICT OF COLUMBIA": "DC",
"FEDERATED STATES OF MICRONESIA": "FM",
"FLORIDA": "FL",
"GEORGIA": "GA",
"GUAM": "GU",
"HAWAII": "HI",
"IDAHO": "ID",
"ILLINOIS": "IL",
"INDIANA": "IN",
"IOWA": "IA",
"KANSAS": "KS",
"KENTUCKY": "KY",
"LOUISIANA": "LA",
"MAINE": "ME",
"MARSHALL ISLANDS": "MH",
"MARYLAND": "MD",
"MASSACHUSETTS": "MA",
"MICHIGAN": "MI",
"MINNESOTA": "MN",
"MISSISSIPPI": "MS",
"MISSOURI": "MO",
"MONTANA": "MT",
"NEBRASKA": "NE",
"NEVADA": "NV",
"NEW HAMPSHIRE": "NH",
"NEW JERSEY": "NJ",
"NEW MEXICO": "NM",
"NEW YORK": "NY",
"NORTH CAROLINA": "NC",
"NORTH DAKOTA": "ND",
"NORTHERN MARIANA ISLANDS": "MP",
"OHIO": "OH",
"OKLAHOMA": "OK",
"OREGON": "OR",
"PALAU": "PW",
"PENNSYLVANIA": "PA",
"PUERTO RICO": "PR",
"RHODE ISLAND": "RI",
"SOUTH CAROLINA": "SC",
"SOUTH DAKOTA": "SD",
"TENNESSEE": "TN",
"TEXAS": "TX",
"UTAH": "UT",
"VERMONT": "VT",
"VIRGIN ISLANDS": "VI",
"VIRGINIA": "VA",
"WASHINGTON": "WA",
"WEST VIRGINIA": "WV",
"WISCONSIN": "WI",
"WYOMING": "WY",
}
func ShortHand(long string) string {
return longToShort[long]
}
func LongHand(short string) string {
return shortToLong[short]
}