Open jlpettersson opened 2 years ago
you need to add Next() call
this is a simple example
columns := []string{"id"}
pgxRows := pgxpoolmock.NewRows(columns).AddRow(100).ToPgxRows()
pgxRows.Next()
suite.mockPool.EXPECT().QueryRow(gomock.Any(), `
INSERT INTO "users"("login", "password")
VALUES ($1, $2)
returning "@users"`, user.Login, user.Password).Return(pgxRows)
When I do a
QueryRow()
query, theScan()
panics with this error:This seem to be related to this line 72:
where
r.pos
is0
.