docs/core/gdb-practice-avoid-object-initialization-and-sql-errnorows-error #248
Replies: 1 comment 1 reply
-
|
这个改进是不是有问题,查询不到时,err非空,就返回了, 不可能走到 if out == nil 这个代码。 sql.ErrNoRows |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
docs/core/gdb-practice-avoid-object-initialization-and-sql-errnorows-error
在使用GoFrame框架进行SQL查询时,避免对象初始化以及sql.ErrNoRows错误判断问题。通过不初始化查询结果对象,使用指针为nil判断的方法,统一项目中对空查询结果的处理逻辑,从而降低代码对错误处理的复杂度。
https://goframe.org.cn/docs/core/gdb-practice-avoid-object-initialization-and-sql-errnorows-error
Beta Was this translation helpful? Give feedback.
All reactions