Closed PumpkinSeed closed 3 years ago
Normalize data structure based on the following rules.
countries.go: the merge of the ....-alpha2.go and ....-alpha3.go
subdivisions.go:
type Country struct { Alpha2 string Alpha3 string Name string OfficialName string CommonName string Numeric string Subdivsions [N]Subdivsion } type Subdivsion struct { Name string Type string LocalName string LanguageCode string ParentCode string } var Countries = [O]Country { ... }
where
O
N
functions.go
ParseCountry(string) Country, error ParseSubdivision(string) Subdivision, error
Normalize data structure based on the following rules.
countries.go: the merge of the ....-alpha2.go and ....-alpha3.go
subdivisions.go:
where
O
is the number of the countriesN
is the number of the subdivisions Subdivisions inside the Subdivisions are forbidden.functions.go