@@ -157,7 +157,7 @@ func (d *decoder) decodeFromType(
157157 }
158158}
159159
160- func (d * decoder ) unmarshalBool (size uint , offset uint , result reflect.Value ) (uint , error ) {
160+ func (d * decoder ) unmarshalBool (size , offset uint , result reflect.Value ) (uint , error ) {
161161 if size > 1 {
162162 return 0 , newInvalidDatabaseError ("the MaxMind DB file's data section contains bad data (bool size of %v)" , size )
163163 }
@@ -206,7 +206,7 @@ func (d *decoder) indirect(result reflect.Value) reflect.Value {
206206
207207var sliceType = reflect .TypeOf ([]byte {})
208208
209- func (d * decoder ) unmarshalBytes (size uint , offset uint , result reflect.Value ) (uint , error ) {
209+ func (d * decoder ) unmarshalBytes (size , offset uint , result reflect.Value ) (uint , error ) {
210210 value , newOffset := d .decodeBytes (size , offset )
211211
212212 switch result .Kind () {
@@ -224,7 +224,7 @@ func (d *decoder) unmarshalBytes(size uint, offset uint, result reflect.Value) (
224224 return newOffset , newUnmarshalTypeError (value , result .Type ())
225225}
226226
227- func (d * decoder ) unmarshalFloat32 (size uint , offset uint , result reflect.Value ) (uint , error ) {
227+ func (d * decoder ) unmarshalFloat32 (size , offset uint , result reflect.Value ) (uint , error ) {
228228 if size != 4 {
229229 return 0 , newInvalidDatabaseError ("the MaxMind DB file's data section contains bad data (float32 size of %v)" , size )
230230 }
@@ -243,8 +243,7 @@ func (d *decoder) unmarshalFloat32(size uint, offset uint, result reflect.Value)
243243 return newOffset , newUnmarshalTypeError (value , result .Type ())
244244}
245245
246- func (d * decoder ) unmarshalFloat64 (size uint , offset uint , result reflect.Value ) (uint , error ) {
247-
246+ func (d * decoder ) unmarshalFloat64 (size , offset uint , result reflect.Value ) (uint , error ) {
248247 if size != 8 {
249248 return 0 , newInvalidDatabaseError ("the MaxMind DB file's data section contains bad data (float 64 size of %v)" , size )
250249 }
@@ -266,7 +265,7 @@ func (d *decoder) unmarshalFloat64(size uint, offset uint, result reflect.Value)
266265 return newOffset , newUnmarshalTypeError (value , result .Type ())
267266}
268267
269- func (d * decoder ) unmarshalInt32 (size uint , offset uint , result reflect.Value ) (uint , error ) {
268+ func (d * decoder ) unmarshalInt32 (size , offset uint , result reflect.Value ) (uint , error ) {
270269 if size > 4 {
271270 return 0 , newInvalidDatabaseError ("the MaxMind DB file's data section contains bad data (int32 size of %v)" , size )
272271 }
@@ -319,7 +318,7 @@ func (d *decoder) unmarshalMap(
319318 }
320319}
321320
322- func (d * decoder ) unmarshalPointer (size uint , offset uint , result reflect.Value , depth int ) (uint , error ) {
321+ func (d * decoder ) unmarshalPointer (size , offset uint , result reflect.Value , depth int ) (uint , error ) {
323322 pointer , newOffset , err := d .decodePointer (size , offset )
324323 if err != nil {
325324 return 0 , err
@@ -349,7 +348,7 @@ func (d *decoder) unmarshalSlice(
349348 return 0 , newUnmarshalTypeError ("array" , result .Type ())
350349}
351350
352- func (d * decoder ) unmarshalString (size uint , offset uint , result reflect.Value ) (uint , error ) {
351+ func (d * decoder ) unmarshalString (size , offset uint , result reflect.Value ) (uint , error ) {
353352 value , newOffset := d .decodeString (size , offset )
354353
355354 switch result .Kind () {
@@ -363,10 +362,9 @@ func (d *decoder) unmarshalString(size uint, offset uint, result reflect.Value)
363362 }
364363 }
365364 return newOffset , newUnmarshalTypeError (value , result .Type ())
366-
367365}
368366
369- func (d * decoder ) unmarshalUint (size uint , offset uint , result reflect.Value , uintType uint ) (uint , error ) {
367+ func (d * decoder ) unmarshalUint (size , offset uint , result reflect.Value , uintType uint ) (uint , error ) {
370368 if size > uintType / 8 {
371369 return 0 , newInvalidDatabaseError ("the MaxMind DB file's data section contains bad data (uint%v size of %v)" , uintType , size )
372370 }
@@ -396,7 +394,7 @@ func (d *decoder) unmarshalUint(size uint, offset uint, result reflect.Value, ui
396394
397395var bigIntType = reflect .TypeOf (big.Int {})
398396
399- func (d * decoder ) unmarshalUint128 (size uint , offset uint , result reflect.Value ) (uint , error ) {
397+ func (d * decoder ) unmarshalUint128 (size , offset uint , result reflect.Value ) (uint , error ) {
400398 if size > 16 {
401399 return 0 , newInvalidDatabaseError ("the MaxMind DB file's data section contains bad data (uint128 size of %v)" , size )
402400 }
@@ -417,30 +415,30 @@ func (d *decoder) unmarshalUint128(size uint, offset uint, result reflect.Value)
417415 return newOffset , newUnmarshalTypeError (value , result .Type ())
418416}
419417
420- func (d * decoder ) decodeBool (size uint , offset uint ) (bool , uint ) {
418+ func (d * decoder ) decodeBool (size , offset uint ) (bool , uint ) {
421419 return size != 0 , offset
422420}
423421
424- func (d * decoder ) decodeBytes (size uint , offset uint ) ([]byte , uint ) {
422+ func (d * decoder ) decodeBytes (size , offset uint ) ([]byte , uint ) {
425423 newOffset := offset + size
426424 bytes := make ([]byte , size )
427425 copy (bytes , d .buffer [offset :newOffset ])
428426 return bytes , newOffset
429427}
430428
431- func (d * decoder ) decodeFloat64 (size uint , offset uint ) (float64 , uint ) {
429+ func (d * decoder ) decodeFloat64 (size , offset uint ) (float64 , uint ) {
432430 newOffset := offset + size
433431 bits := binary .BigEndian .Uint64 (d .buffer [offset :newOffset ])
434432 return math .Float64frombits (bits ), newOffset
435433}
436434
437- func (d * decoder ) decodeFloat32 (size uint , offset uint ) (float32 , uint ) {
435+ func (d * decoder ) decodeFloat32 (size , offset uint ) (float32 , uint ) {
438436 newOffset := offset + size
439437 bits := binary .BigEndian .Uint32 (d .buffer [offset :newOffset ])
440438 return math .Float32frombits (bits ), newOffset
441439}
442440
443- func (d * decoder ) decodeInt (size uint , offset uint ) (int , uint ) {
441+ func (d * decoder ) decodeInt (size , offset uint ) (int , uint ) {
444442 newOffset := offset + size
445443 var val int32
446444 for _ , b := range d .buffer [offset :newOffset ] {
@@ -540,7 +538,7 @@ func (d *decoder) decodeSlice(
540538 return offset , nil
541539}
542540
543- func (d * decoder ) decodeString (size uint , offset uint ) (string , uint ) {
541+ func (d * decoder ) decodeString (size , offset uint ) (string , uint ) {
544542 newOffset := offset + size
545543 return string (d .buffer [offset :newOffset ]), newOffset
546544}
@@ -628,7 +626,7 @@ func cachedFields(result reflect.Value) *fieldsType {
628626 return fields
629627}
630628
631- func (d * decoder ) decodeUint (size uint , offset uint ) (uint64 , uint ) {
629+ func (d * decoder ) decodeUint (size , offset uint ) (uint64 , uint ) {
632630 newOffset := offset + size
633631 bytes := d .buffer [offset :newOffset ]
634632
@@ -639,7 +637,7 @@ func (d *decoder) decodeUint(size uint, offset uint) (uint64, uint) {
639637 return val , newOffset
640638}
641639
642- func (d * decoder ) decodeUint128 (size uint , offset uint ) (* big.Int , uint ) {
640+ func (d * decoder ) decodeUint128 (size , offset uint ) (* big.Int , uint ) {
643641 newOffset := offset + size
644642 val := new (big.Int )
645643 val .SetBytes (d .buffer [offset :newOffset ])
@@ -685,7 +683,7 @@ func (d *decoder) decodeKey(offset uint) ([]byte, uint, error) {
685683// This function is used to skip ahead to the next value without decoding
686684// the one at the offset passed in. The size bits have different meanings for
687685// different data types
688- func (d * decoder ) nextValueOffset (offset uint , numberToSkip uint ) (uint , error ) {
686+ func (d * decoder ) nextValueOffset (offset , numberToSkip uint ) (uint , error ) {
689687 if numberToSkip == 0 {
690688 return offset , nil
691689 }
0 commit comments