diff --git a/crud.go b/crud.go index 456cce0..1349b53 100644 --- a/crud.go +++ b/crud.go @@ -7,20 +7,22 @@ import ( "strings" "time" - "github.com/davecgh/go-spew/spew" mgo "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) +// ErrorWithStack is error which stored its stack trace type ErrorWithStack struct { Message string StackTrace string } +// Error returns error message func (e *ErrorWithStack) Error() string { return e.Message } +// Stack returns strack trace to error origin func (e *ErrorWithStack) Stack() string { return e.StackTrace } @@ -181,7 +183,7 @@ func ReadCollection(db *mgo.Database, results interface{}, filter bson.M, select sortM[s] = 1 } } - spew.Dump(sortM) + // spew.Dump(sortM) pipeline = append(pipeline, bson.M{ "$sort": sortM, }) @@ -214,7 +216,7 @@ func ReadCollection(db *mgo.Database, results interface{}, filter bson.M, select idToObjectID(filter) - spew.Dump(filter) + // spew.Dump(filter) q := c.Find(filter) if selector != nil { diff --git a/go.mod b/go.mod index 1ea1416..48bd15e 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module gitbase.de/gopackage/mgocrud go 1.16 require ( - github.com/davecgh/go-spew v1.1.1 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/go-playground/assert.v1 v1.2.1 // indirect gopkg.in/go-playground/validator.v8 v8.18.2 diff --git a/go.sum b/go.sum index ed7f7f6..f2b3b5a 100644 --- a/go.sum +++ b/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/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=