DEV Community

Discussion on: A clean way to implement database transaction in Golang

Collapse
 
ahmedarmohamed profile image
Ahmed Mohamed

I'm getting
=== RUN TestTransferTx
panic: test timed out after 30s
How do I go about it?

Collapse
 
long_lngc_d60d5bbe92c4 profile image
Long Lê Ngọc

You should replace this code in main_test.go:

testDB, err := sql.Open(dbDriver, dbSource) with testDB, err = sql.Open(dbDriver, dbSource).
Because testDB and err were declare, so you shouldn't use :=, just use =