Closed MeelyNe closed 8 months ago
This is not pgxmock
code. What is EXPECT()
? What is gomock
anyway?
This is not
pgxmock
code. What isEXPECT()
? What isgomock
anyway?
I use github.com/uber-go/mock, cuz we use wrapper around default pgxpool.Pool
as DB . But I was thinking of using use your library just for mock rows )
No, sorry. That doesn't work that way )
OK :( I'm sorry, can you recommend an alternative? (
Well, you should use uber-go/mock
for everything. Usually mock libs are packed with all tools needed
Describe the bug pgxmock.Rows returns panic if business code closes it
To Reproduce
on test:
Expected behavior not panic )
Version github.com/jackc/pgx/v5 v5.5.2 github.com/pashagolub/pgxmock/v3 v3.3.0
Console Output
[PANICKED] Test Panicked In [It] at: /usr/local/go/src/runtime/panic.go:261 @ 02/14/24 16:39:15.544
runtime error: invalid memory address or nil pointer dereference
Full Stack Trace github.com/pashagolub/pgxmock/v3.(*rowSets).Close(0xc000387d28?) /home/username/GolandProjects/myProject/vendor/github.com/pashagolub/pgxmock/v3/rows.go:53 +0x4