I'm trying to use db2cli library (https://bitbucket.org/phiggins/db2cli/) to implement DB2 queries (select, insert, delete). But get CGO error when trying to run select queries. Here is my code:
db, err := sql.Open("db2-cli", *connStr)
if err != nil {
return err
}
defer db.Close()
rows, err := db.Query("select * from tab")
The error is:
panic: runtime error: cgo argument has Go pointer to Go pointer
goroutine 1 [running]:
bitbucket.org/phiggins/db2cli/api.SQLBindCol.func1(0x9000100010001, 0xc420062238, 0xa00000006, 0xc420062218, 0x5b00000040)
......
If I manually run the select queries from DB2 command line, it will return correct results. And other type of queries (insert, delete etc.) with Go language code also work correctly. I tried to set GODEBUG=cgocheck=0, but still get the same issue. Has anyone encountered similar problems when using db2cli?