Skip to content

Commit 51f1e57

Browse files
committed
Clean up some linter issues in test
1 parent 86e7363 commit 51f1e57

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

reader_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func TestDecodingToInterface(t *testing.T) {
8181
assert.Equal(t, record["uint128"], bigInt)
8282
}
8383

84+
// nolint: maligned
8485
type TestType struct {
8586
Array []uint `maxminddb:"array"`
8687
Boolean bool `maxminddb:"boolean"`
@@ -526,9 +527,9 @@ func BenchmarkMaxMindDB(b *testing.B) {
526527
r := rand.New(rand.NewSource(time.Now().UnixNano()))
527528
var result interface{}
528529

529-
ip := make(net.IP, 4, 4)
530+
ip := make(net.IP, 4)
530531
for i := 0; i < b.N; i++ {
531-
randomIPv4Address(b, r, ip)
532+
randomIPv4Address(r, ip)
532533
err = db.Lookup(ip, &result)
533534
assert.Nil(b, err)
534535
}
@@ -548,16 +549,16 @@ func BenchmarkCountryCode(b *testing.B) {
548549
r := rand.New(rand.NewSource(0))
549550
var result MinCountry
550551

551-
ip := make(net.IP, 4, 4)
552+
ip := make(net.IP, 4)
552553
for i := 0; i < b.N; i++ {
553-
randomIPv4Address(b, r, ip)
554+
randomIPv4Address(r, ip)
554555
err = db.Lookup(ip, &result)
555556
assert.Nil(b, err)
556557
}
557558
assert.Nil(b, db.Close(), "error on close")
558559
}
559560

560-
func randomIPv4Address(b *testing.B, r *rand.Rand, ip []byte) {
561+
func randomIPv4Address(r *rand.Rand, ip []byte) {
561562
num := r.Uint32()
562563
ip[0] = byte(num >> 24)
563564
ip[1] = byte(num >> 16)

0 commit comments

Comments
 (0)