Export GODEBUG=cgocheck=0

my code works well if this env variable is set or else it produces error. I know that this env disables some guide lines go. what are those and how to solve it.

THANKS IN ADVANCE

Which error? Knowing the error you get and the code that produces it might improve your chances to actually get a solution to your problem instead of a workaround.

go version go1.11.3 linux/amd64

goroutine 16 [running]:
github.com/ibmdb/go_ibm_db/api.SQLBindCol.func1(0x4000100010001, 0xc00005c338, 0xc000000004, 0xc00005c318, 0x4edfa0)
/home/rakhil/go/src/github.com/ibmdb/go_ibm_db/api/zapi_unix.go:26 +0x4c
github.com/ibmdb/go_ibm_db/api.SQLBindCol(0x4000100010001, 0xc00005c338, 0x4, 0xc00005c318, 0x0)
/home/rakhil/go/src/github.com/ibmdb/go_ibm_db/api/zapi_unix.go:26 +0x59
github.com/ibmdb/go_ibm_db.(*BufferLen).Bind(0xc00005c318, 0x10001, 0x0, 0x440004, 0xc00005c338, 0x4, 0x8, 0xc000010350)
/home/rakhil/go/src/github.com/ibmdb/go_ibm_db/column.go:29 +0x62
github.com/ibmdb/go_ibm_db.(*BindableColumn).Bind(0xc00005c300, 0x10001, 0x0, 0xc00005c300, 0x0, 0x0)
/home/rakhil/go/src/github.com/ibmdb/go_ibm_db/column.go:202 +0x6c
github.com/ibmdb/go_ibm_db.(*ODBCStmt).BindColumns(0xc000096140, 0x7d9de0, 0x0)
/home/rakhil/go/src/github.com/ibmdb/go_ibm_db/odbcstmt.go:148 +0x1eb
github.com/ibmdb/go_ibm_db.(*Stmt).Query(0xc0000802d0, 0x7d9de0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/rakhil/go/src/github.com/ibmdb/go_ibm_db/stmt.go:93 +0xe5
database/sql.ctxDriverStmtQuery(0x513000, 0xc000016168, 0x513100, 0xc0000802d0, 0x7d9de0, 0x0, 0x0, 0x0, 0x0, 0x0, …)
/work/rakhil/go/src/database/sql/ctxutil.go:94 +0x16b
database/sql.rowsiFromStatement(0x513000, 0xc000016168, 0x512f00, 0xc000010290, 0xc00005c240, 0x0, 0x0, 0x0, 0x0, 0x0, …)
/work/rakhil/go/src/database/sql/sql.go:2511 +0x159
database/sql.(*Stmt).QueryContext(0xc0000a8000, 0x513000, 0xc000016168, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/work/rakhil/go/src/database/sql/sql.go:2463 +0x203
database/sql.(*Stmt).QueryRowContext(0xc0000a8000, 0x513000, 0xc000016168, 0x0, 0x0, 0x0, 0xc000016248)
/work/rakhil/go/src/database/sql/sql.go:2521 +0x6d
database/sql.(*Stmt).QueryRow(0xc0000a8000, 0x0, 0x0, 0x0, 0x0)
/work/rakhil/go/src/database/sql/sql.go:2540 +0x61
main.main.func1(0xc0000a8000, 0xc0000a8090, 0xc00001c2a0)
/home/rakhil/go/src/github.com/bradfitz/go-sql-test/src/akh.go:46 +0x87
created by main.main
/home/rakhil/go/src/github.com/bradfitz/go-sql-test/src/akh.go:43 +0x472

I am using github.com/ibmdb/go_ibm_db driver. For windows it uses only go and for linux it uses cgo. so when i run the same code it works for windows and it produces error in linux/.

I do not have a IBM DB available to test, but please make sure you followed installation instructions for linux to the letter.

If everything is installed correctly and you still get that output, you should probably open an issue in the repository or ask for support over there. Your problem seems to be very specific to that DB driver.

And I doubt that there are much people on this forum that have a IBM DB2 license available to check with your problem.

I have followed all the steps. Can i know why that error occurs.

As I said already, you probably need to seek support from the maintainers of the library.

I am one of the maintainer of that library. It was developed by some one and i just started taking care of it and i don’t know why this error occurs. The guy who developed it is not available.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.