File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,6 @@ import (
88 "github.com/oschwald/maxminddb-golang"
99)
1010
11- type onlyCountry struct {
12- Country struct {
13- ISOCode string `maxminddb:"iso_code"`
14- } `maxminddb:"country"`
15- }
16-
1711// This example shows how to decode to a struct
1812func ExampleReader_Lookup_struct () {
1913 db , err := maxminddb .Open ("test-data/test-data/GeoIP2-City-Test.mmdb" )
@@ -24,7 +18,12 @@ func ExampleReader_Lookup_struct() {
2418
2519 ip := net .ParseIP ("81.2.69.142" )
2620
27- var record onlyCountry // Or any appropriate struct
21+ var record struct {
22+ Country struct {
23+ ISOCode string `maxminddb:"iso_code"`
24+ } `maxminddb:"country"`
25+ } // Or any appropriate struct
26+
2827 err = db .Lookup (ip , & record )
2928 if err != nil {
3029 log .Fatal (err )
You can’t perform that action at this time.
0 commit comments