File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -311,7 +311,7 @@ func TestDecoder(t *testing.T) {
311
311
require .NoError (t , result .Err ())
312
312
require .True (t , result .Found ())
313
313
314
- res := reader .LookupOffset (result .RecordOffset ())
314
+ res := reader .LookupOffset (result .Offset ())
315
315
require .NoError (t , res .Decode (& testV ))
316
316
verify (testV )
317
317
}
@@ -564,7 +564,7 @@ func TestNestedOffsetDecode(t *testing.T) {
564
564
TimeZoneOffset uintptr `maxminddb:"time_zone"`
565
565
} `maxminddb:"location"`
566
566
}
567
- res := db .LookupOffset (result .RecordOffset ())
567
+ res := db .LookupOffset (result .Offset ())
568
568
require .NoError (t , res .Decode (& root ))
569
569
assert .InEpsilon (t , 51.5142 , root .Location .Latitude , 1e-10 )
570
570
Original file line number Diff line number Diff line change @@ -107,14 +107,14 @@ func (r Result) Found() bool {
107
107
return r .err == nil && r .offset != notFound
108
108
}
109
109
110
- // RecordOffset returns the offset of the record in the database. This can be
111
- // passed to ReaderDecode. It can also be used as a unique identifier for the
112
- // data record in the particular database to cache the data record across
113
- // lookups. Note that while the offset uniquely identifies the data record,
114
- // other data in Result may differ between lookups. The offset is only valid
115
- // for the current database version. If you update the database file, you must
116
- // invalidate any cache associated with the previous version.
117
- func (r Result ) RecordOffset () uintptr {
110
+ // Offset returns the offset of the record in the database. This can be
111
+ // passed to (*Reader).LookupOffset. It can also be used as a unique
112
+ // identifier for the data record in the particular database to cache the data
113
+ // record across lookups. Note that while the offset uniquely identifies the
114
+ // data record, other data in Result may differ between lookups. The offset
115
+ // is only valid for the current database version. If you update the database
116
+ // file, you must invalidate any cache associated with the previous version.
117
+ func (r Result ) Offset () uintptr {
118
118
return uintptr (r .offset )
119
119
}
120
120
You can’t perform that action at this time.
0 commit comments