Skip to content

Commit

Permalink
Use correct capitalization. Close #4
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Sep 5, 2020
1 parent 7422776 commit 395153f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -53,7 +53,7 @@ func main() {
fmt.Printf("English subdivision name: %v\n", record.Subdivisions[0].Names["en"])
}
fmt.Printf("Russian country name: %v\n", record.Country.Names["ru"])
fmt.Printf("ISO country code: %v\n", record.Country.IsoCode)
fmt.Printf("ISO country code: %v\n", record.Country.ISOCode)
fmt.Printf("Time zone: %v\n", record.Location.TimeZone)
fmt.Printf("Coordinates: %v, %v\n", record.Location.Latitude, record.Location.Longitude)
// Output:
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Expand Up @@ -23,7 +23,7 @@ func Example() {
fmt.Printf("Portuguese (BR) city name: %v\n", record.City.Names.PtBR)
fmt.Printf("English subdivision name: %v\n", record.Subdivisions[0].Names.En)
fmt.Printf("Russian country name: %v\n", record.Country.Names.Ru)
fmt.Printf("ISO country code: %v\n", record.Country.IsoCode)
fmt.Printf("ISO country code: %v\n", record.Country.ISOCode)
fmt.Printf("Time zone: %v\n", record.Location.TimeZone)
fmt.Printf("Coordinates: %v, %v\n", record.Location.Latitude, record.Location.Longitude)
// Output:
Expand Down
22 changes: 11 additions & 11 deletions reader.go
Expand Up @@ -41,7 +41,7 @@ type Enterprise struct {
} `maxminddb:"continent" json:"continent,omitempty"`
Country struct {
GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id,omitempty"`
IsoCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
ISOCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
Names Names `maxminddb:"names" json:"names,omitempty"`
Confidence uint8 `maxminddb:"confidence" json:"confidence,omitempty"`
IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"is_in_european_union,omitempty"`
Expand All @@ -59,22 +59,22 @@ type Enterprise struct {
} `maxminddb:"postal" json:"postal,omitempty"`
RegisteredCountry struct {
GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id,omitempty"`
IsoCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
ISOCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
Names Names `maxminddb:"names" json:"names,omitempty"`
Confidence uint8 `maxminddb:"confidence" json:"confidence,omitempty"`
IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"is_in_european_union,omitempty"`
} `maxminddb:"registered_country" json:"registered_country,omitempty"`
RepresentedCountry struct {
GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id,omitempty"`
IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"is_in_european_union,omitempty"`
IsoCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
ISOCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
Names Names `maxminddb:"names" json:"names,omitempty"`
Type string `maxminddb:"type" json:"type,omitempty"`
} `maxminddb:"represented_country" json:"represented_country,omitempty"`
Subdivisions []struct {
Confidence uint8 `maxminddb:"confidence" json:"confidence,omitempty"`
GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id,omitempty"`
IsoCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
ISOCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
Names Names `maxminddb:"names" json:"names,omitempty"`
} `maxminddb:"subdivisions" json:"subdivisions,omitempty"`
Traits struct {
Expand Down Expand Up @@ -107,7 +107,7 @@ type City struct {
Country struct {
GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id,omitempty"`
IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"is_in_european_union,omitempty"`
IsoCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
ISOCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
Names Names `maxminddb:"names" json:"names,omitempty"`
} `maxminddb:"country" json:"country,omitempty"`
Location struct {
Expand All @@ -123,19 +123,19 @@ type City struct {
RegisteredCountry struct {
GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id,omitempty"`
IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"is_in_european_union,omitempty"`
IsoCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
ISOCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
Names Names `maxminddb:"names" json:"names,omitempty"`
} `maxminddb:"registered_country" json:"registered_country,omitempty"`
RepresentedCountry struct {
GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id,omitempty"`
IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"is_in_european_union,omitempty"`
IsoCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
ISOCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
Names Names `maxminddb:"names" json:"names,omitempty"`
Type string `maxminddb:"type" json:"type,omitempty"`
} `maxminddb:"represented_country" json:"represented_country,omitempty"`
Subdivisions []struct {
GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id,omitempty"`
IsoCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
ISOCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
Names Names `maxminddb:"names" json:"names,omitempty"`
} `maxminddb:"subdivisions" json:"subdivisions,omitempty"`
Traits struct {
Expand All @@ -155,19 +155,19 @@ type Country struct {
Country struct {
GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id,omitempty"`
IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"is_in_european_union,omitempty"`
IsoCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
ISOCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
Names Names `maxminddb:"names" json:"names,omitempty"`
} `maxminddb:"country" json:"country,omitempty"`
RegisteredCountry struct {
GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id,omitempty"`
IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"is_in_european_union,omitempty"`
IsoCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
ISOCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
Names Names `maxminddb:"names" json:"names,omitempty"`
} `maxminddb:"registered_country" json:"registered_country,omitempty"`
RepresentedCountry struct {
GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id,omitempty"`
IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"is_in_european_union,omitempty"`
IsoCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
ISOCode string `maxminddb:"iso_code" json:"iso_code,omitempty"`
Names Names `maxminddb:"names" json:"names,omitempty"`
Type string `maxminddb:"type" json:"type,omitempty"`
} `maxminddb:"represented_country" json:"represented_country,omitempty"`
Expand Down
6 changes: 3 additions & 3 deletions reader_test.go
Expand Up @@ -66,7 +66,7 @@ func TestReader(t *testing.T) {

assert.Equal(t, uint(2635167), record.Country.GeoNameID)
assert.True(t, record.Country.IsInEuropeanUnion)
assert.Equal(t, "GB", record.Country.IsoCode)
assert.Equal(t, "GB", record.Country.ISOCode)
assert.Equal(t,
Names {
De: "Vereinigtes Königreich",
Expand All @@ -87,7 +87,7 @@ func TestReader(t *testing.T) {
assert.Equal(t, "Europe/London", record.Location.TimeZone)

assert.Equal(t, uint(6269131), record.Subdivisions[0].GeoNameID)
assert.Equal(t, "ENG", record.Subdivisions[0].IsoCode)
assert.Equal(t, "ENG", record.Subdivisions[0].ISOCode)
assert.Equal(t,
Names {
En: "England",
Expand All @@ -100,7 +100,7 @@ func TestReader(t *testing.T) {

assert.Equal(t, uint(6252001), record.RegisteredCountry.GeoNameID)
assert.False(t, record.RegisteredCountry.IsInEuropeanUnion)
assert.Equal(t, "US", record.RegisteredCountry.IsoCode)
assert.Equal(t, "US", record.RegisteredCountry.ISOCode)
assert.Equal(t,
Names{
De: "USA",
Expand Down

0 comments on commit 395153f

Please sign in to comment.