Skip to content

Commit

Permalink
add db util
Browse files Browse the repository at this point in the history
  • Loading branch information
junqiang.zhang committed May 4, 2022
1 parent 501736a commit 6fd014f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ func NewMockXORM(pathToSqlFileName string) *mockdb.MockXORM {
return mockdb.NewMockXORM(pathToSqlFileName)
}

func NewDBUtil(pathToSqlFileName string) *util.DBUtil {
func NewDBUtil() *util.DBUtil {
return util.NewDBUtil()
}
2 changes: 1 addition & 1 deletion util/util_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (u *DBUtil) QueryOneBySQL(db *sql.DB, sqlStr string, args ...interface{}) (
return row, nil
}

func (u *DBUtil) QueryObjectBySQL(db *sql.DB, obj interface, sqlStr string, args ...interface{}) error {
func (u *DBUtil) QueryObjectBySQL(db *sql.DB, obj interface{}, sqlStr string, args ...interface{}) error {
if reflect.TypeOf(obj).Kind() != reflect.Ptr {
errors.New("obj must be a pointer")
}
Expand Down

0 comments on commit 6fd014f

Please sign in to comment.