From 95dedae37cec60ebaeb657317a3f2a89c0b333e9 Mon Sep 17 00:00:00 2001 From: Felix Gunawan Date: Sat, 5 Aug 2023 12:07:32 +0700 Subject: [PATCH] fix lint error --- tools/sqldatabase/mysql/mysql.go | 4 ++-- tools/sqldatabase/postgresql/postgresql.go | 4 ++-- tools/sqldatabase/sqlite3/sqlite3.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/sqldatabase/mysql/mysql.go b/tools/sqldatabase/mysql/mysql.go index 0f1475b58..13865aa97 100644 --- a/tools/sqldatabase/mysql/mysql.go +++ b/tools/sqldatabase/mysql/mysql.go @@ -66,8 +66,8 @@ func (m MySQL) Query(ctx context.Context, query string, args ...any) ([]string, if err != nil { return nil, nil, err } - for _, v := range rowNullable { - row = append(row, v.String) + for i := range rowNullable { + row[i] = rowNullable[i].String } results = append(results, row) } diff --git a/tools/sqldatabase/postgresql/postgresql.go b/tools/sqldatabase/postgresql/postgresql.go index 3e71981d3..dc4f7eb56 100644 --- a/tools/sqldatabase/postgresql/postgresql.go +++ b/tools/sqldatabase/postgresql/postgresql.go @@ -73,8 +73,8 @@ func (p PostgreSQL) Query(ctx context.Context, query string, args ...any) ([]str if err != nil { return nil, nil, err } - for _, v := range rowNullable { - row = append(row, v.String) + for i := range rowNullable { + row[i] = rowNullable[i].String } results = append(results, row) } diff --git a/tools/sqldatabase/sqlite3/sqlite3.go b/tools/sqldatabase/sqlite3/sqlite3.go index 118befa8f..89d30e398 100644 --- a/tools/sqldatabase/sqlite3/sqlite3.go +++ b/tools/sqldatabase/sqlite3/sqlite3.go @@ -65,8 +65,8 @@ func (m SQLite3) Query(ctx context.Context, query string, args ...any) ([]string if err != nil { return nil, nil, err } - for _, v := range rowNullable { - row = append(row, v.String) + for i := range rowNullable { + row[i] = rowNullable[i].String } results = append(results, row) }