使用go-sqlmock在SQL查询中获取参数值

I'm currently using go-sqlmock to mock my database.

Is there any way to get the values that have been passed to the sql driver when performing a query?. Like the arg variable that is been passing as argument here:

import (
   "database/sql"
)

func retrieveInfo(){
    // this function returns an initialized instance of type *sql.DB
    DbDriver := initDb()

    query := "my query"
    arg := 3
    rows, err := Db_driver.Query(query, arg)
    // ...
}

Then I want to test the function, and I would like to know the value of the variable arg while testing. I think it should be possible, since it is passed to the "fake" driver that go-sqlmock creates. My test logic looks like this:

import "github.com/DATA-DOG/go-sqlmock"

// Inits mock and overwrites the original driver
db, mock, err := sqlmock.New()
Db_driver = db

func TestRetrieveInfo(t *testing.T){
   // query that matchs the one in retrieveInfo()
   query := "..."
   queryRows := sqlmock.NewRows([]string{"column1, column2"}).FromCSVString("value1, value2")
   mock.ExpectQuery(query).WillReturnRows(queryRows)
}

You can wrap the real driver with instrumentation to log the values.

Use package github.com/luna-duclos/instrumentedsql.