Fix lint and format code in client/orm dir
This commit is contained in:
@@ -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...)
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user