Fix lint and format code in client/orm dir

This commit is contained in:
loyalsoldier
2021-06-06 20:52:38 +08:00
parent ca328208cc
commit 1b8c801ec6
32 changed files with 108 additions and 137 deletions

View File

@@ -55,7 +55,6 @@ func (o *OrmStub) Clear() {
func (o *OrmStub) FilterChain(next orm.Filter) orm.Filter {
return func(ctx context.Context, inv *orm.Invocation) []interface{} {
ms := mockFromCtx(ctx)
ms = append(ms, o.ms...)

View File

@@ -247,7 +247,7 @@ func TestTransactionRollbackUnlessCommit(t *testing.T) {
mock := errors.New(mockErrorMsg)
s.Mock(MockRollbackUnlessCommit(mock))
//u := &User{}
// u := &User{}
o := orm.NewOrm()
txOrm, _ := o.Begin()
err := txOrm.RollbackUnlessCommit()

View File

@@ -22,8 +22,7 @@ import (
// DoNothingQueryM2Mer do nothing
// use it to build mock orm.QueryM2Mer
type DoNothingQueryM2Mer struct {
}
type DoNothingQueryM2Mer struct{}
func (d *DoNothingQueryM2Mer) AddWithCtx(ctx context.Context, i ...interface{}) (int64, error) {
return 0, nil

View File

@@ -23,8 +23,7 @@ import (
// DoNothingQuerySetter do nothing
// usually you use this to build your mock QuerySetter
type DoNothingQuerySetter struct {
}
type DoNothingQuerySetter struct{}
func (d *DoNothingQuerySetter) OrderClauses(orders ...*order_clause.Order) orm.QuerySeter {
return d

View File

@@ -20,8 +20,7 @@ import (
"github.com/beego/beego/v2/client/orm"
)
type DoNothingRawSetter struct {
}
type DoNothingRawSetter struct{}
func (d *DoNothingRawSetter) Exec() (sql.Result, error) {
return nil, nil