From 42da570e9ef0d47896249e7d92593cb0a1a49277 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 9 Nov 2024 08:43:23 -0600 Subject: [PATCH] Make argument order match accepted proposal. --- api/next/67546.txt | 2 +- src/database/sql/driver/driver.go | 2 +- src/database/sql/sql.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/next/67546.txt b/api/next/67546.txt index 90b253770e4..0b5b4b981c1 100644 --- a/api/next/67546.txt +++ b/api/next/67546.txt @@ -2,4 +2,4 @@ pkg database/sql/driver, type RowsColumnScanner interface { Close, Columns, Next pkg database/sql/driver, type RowsColumnScanner interface, Close() error #67546 pkg database/sql/driver, type RowsColumnScanner interface, Columns() []string #67546 pkg database/sql/driver, type RowsColumnScanner interface, Next([]Value) error #67546 -pkg database/sql/driver, type RowsColumnScanner interface, ScanColumn(int, interface{}) error #67546 +pkg database/sql/driver, type RowsColumnScanner interface, ScanColumn(interface{}, int) error #67546 diff --git a/src/database/sql/driver/driver.go b/src/database/sql/driver/driver.go index 22a2e7611a2..487870be632 100644 --- a/src/database/sql/driver/driver.go +++ b/src/database/sql/driver/driver.go @@ -524,7 +524,7 @@ type RowsColumnScanner interface { // ScanColumn copies the column in the current row into the value pointed at by // dest. It returns [ErrSkip] to fall back to the normal [database/sql] scanning path. - ScanColumn(index int, dest any) error + ScanColumn(dest any, index int) error } // Tx is a transaction. diff --git a/src/database/sql/sql.go b/src/database/sql/sql.go index 4f0250c9fdb..2cf081adbae 100644 --- a/src/database/sql/sql.go +++ b/src/database/sql/sql.go @@ -3400,7 +3400,7 @@ func (rs *Rows) Scan(dest ...any) error { err := driver.ErrSkip if rowsColumnScanner, ok := rs.rowsi.(driver.RowsColumnScanner); ok { - err = rowsColumnScanner.ScanColumn(i, dest[i]) + err = rowsColumnScanner.ScanColumn(dest[i], i) } if err == driver.ErrSkip {