diff --git a/README.md b/README.md index 4bab903..71ddaf7 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/example_test.go b/example_test.go index 2597077..b681db3 100644 --- a/example_test.go +++ b/example_test.go @@ -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: diff --git a/reader.go b/reader.go index a57d117..f3c99eb 100644 --- a/reader.go +++ b/reader.go @@ -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"` @@ -59,7 +59,7 @@ 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"` @@ -67,14 +67,14 @@ type Enterprise struct { 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 { @@ -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 { @@ -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 { @@ -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"` diff --git a/reader_test.go b/reader_test.go index fb453c3..7bdd78d 100644 --- a/reader_test.go +++ b/reader_test.go @@ -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", @@ -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", @@ -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",