英文: DB mock using sqlmock not working for testing Gin/GORM API? 问题 我有一个使用Gin编写的API,使用GORM进行ORM操作。当使用...
使用go-sqlmock创建gorm数据库(运行时错误)
英文: Creating a gorm database with go-sqlmock (runtime error) 问题 摘要 我正在尝试在测试中使用go-sqlmock和gorm。我想为初始数...
Go sqlmock 测试 MySQL 批量插入
英文: Go sqlmock test MySQL batch insert 问题 我正在使用GORM将多行数据批量插入到MySQL表中,并且我想使用sqlmock来测试其行为是否正确。关于使用sql...
Go Unit test – could not match actual sql with expected regexp while mocking gorm using go-sqlmock?
英文: Go Unit test - could not match actual sql with expected regexp while mocking gorm using go-sqlmo...
在Go中使用映射来模拟选择操作,返回了预期的事务开始错误。
英文: Mocking a select with mapping in Go is returning expected transaction begin error 问题 我正在尝试使用go-s...
测试 sqlmock 中的 SQL 表值参数
英文: Testing SQL table-valued parameters in sqlmock 问题 我有一个函数,旨在使用表值参数和存储过程将大量元素插入到 MSSQL 数据库中。 func ...
在使用go-sqlmock模拟gorm的`updates`时出现了`could not match actual sql`错误。
英文: `could not match actual sql` error while mocking gorm `updates` using go-sqlmock? 问题 repository....
2