You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
版本:v1.25.12
参考 #6105 中的方法进行设置后,使用 Find 查询依然无法触发 ErrRecordNotFound 错误
当取消注解
gormDB = gormDB.WithContext(gormDB.Statement.Context)
后可以正常生效。参考上面源码发现在调用
getInstance()
如果clone
为 1, 则不直接进行Statement.clone()
而是生成一个新的Statement
,这将导致设置的RaiseErrorOnNotFound
被忽略,是否可以考虑在clone为1时,也带上 RaiseErrorOnNotFound 设置呢?如下:The text was updated successfully, but these errors were encountered: