removed spew dumps
This commit is contained in:
parent
c73033684a
commit
161e3b46fb
8
crud.go
8
crud.go
@ -7,20 +7,22 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
|
||||||
mgo "gopkg.in/mgo.v2"
|
mgo "gopkg.in/mgo.v2"
|
||||||
"gopkg.in/mgo.v2/bson"
|
"gopkg.in/mgo.v2/bson"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// ErrorWithStack is error which stored its stack trace
|
||||||
type ErrorWithStack struct {
|
type ErrorWithStack struct {
|
||||||
Message string
|
Message string
|
||||||
StackTrace string
|
StackTrace string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Error returns error message
|
||||||
func (e *ErrorWithStack) Error() string {
|
func (e *ErrorWithStack) Error() string {
|
||||||
return e.Message
|
return e.Message
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stack returns strack trace to error origin
|
||||||
func (e *ErrorWithStack) Stack() string {
|
func (e *ErrorWithStack) Stack() string {
|
||||||
return e.StackTrace
|
return e.StackTrace
|
||||||
}
|
}
|
||||||
@ -181,7 +183,7 @@ func ReadCollection(db *mgo.Database, results interface{}, filter bson.M, select
|
|||||||
sortM[s] = 1
|
sortM[s] = 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spew.Dump(sortM)
|
// spew.Dump(sortM)
|
||||||
pipeline = append(pipeline, bson.M{
|
pipeline = append(pipeline, bson.M{
|
||||||
"$sort": sortM,
|
"$sort": sortM,
|
||||||
})
|
})
|
||||||
@ -214,7 +216,7 @@ func ReadCollection(db *mgo.Database, results interface{}, filter bson.M, select
|
|||||||
|
|
||||||
idToObjectID(filter)
|
idToObjectID(filter)
|
||||||
|
|
||||||
spew.Dump(filter)
|
// spew.Dump(filter)
|
||||||
|
|
||||||
q := c.Find(filter)
|
q := c.Find(filter)
|
||||||
if selector != nil {
|
if selector != nil {
|
||||||
|
1
go.mod
1
go.mod
@ -3,7 +3,6 @@ module gitbase.de/gopackage/mgocrud
|
|||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/davecgh/go-spew v1.1.1
|
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
||||||
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
|
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
|
||||||
gopkg.in/go-playground/validator.v8 v8.18.2
|
gopkg.in/go-playground/validator.v8 v8.18.2
|
||||||
|
2
go.sum
2
go.sum
@ -1,5 +1,3 @@
|
|||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
||||||
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
|
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
|
||||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
|
Loading…
Reference in New Issue
Block a user