From e6a1f70adc4c012469daf3102669304727b4e978 Mon Sep 17 00:00:00 2001 From: Dmitry Kropachev Date: Wed, 3 Sep 2025 06:57:07 -0400 Subject: [PATCH] Fix panic in tests in queryx_bench_test.go (#339) This panic cause by Queryx struct having no Mapper and no gocql.Query in it. --- queryx_bench_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/queryx_bench_test.go b/queryx_bench_test.go index 722bdce..422a3cd 100644 --- a/queryx_bench_test.go +++ b/queryx_bench_test.go @@ -7,6 +7,8 @@ package gocqlx_test import ( "testing" + "github.com/gocql/gocql" + "github.com/scylladb/gocqlx/v3" ) @@ -20,7 +22,9 @@ func BenchmarkCompileNamedQuery(b *testing.B) { func BenchmarkQueryxBindStruct(b *testing.B) { q := gocqlx.Queryx{ - Names: []string{"name", "age", "first", "last"}, + Names: []string{"name", "age", "first", "last"}, + Mapper: gocqlx.DefaultMapper, + Query: &gocql.Query{}, } type t struct { Name string @@ -37,7 +41,9 @@ func BenchmarkQueryxBindStruct(b *testing.B) { func BenchmarkBindMap(b *testing.B) { q := gocqlx.Queryx{ - Names: []string{"name", "age", "first", "last"}, + Names: []string{"name", "age", "first", "last"}, + Mapper: gocqlx.DefaultMapper, + Query: &gocql.Query{}, } am := map[string]interface{}{ "name": "Jason Moiron",