Skip to content

Commit

Permalink
Merge commit '0454966c021aa1737c9680aceef7e2ba26952fe3' into merge
Browse files Browse the repository at this point in the history
* commit '0454966c021aa1737c9680aceef7e2ba26952fe3':
  do not lock while writing to a socket (#52) (#54)
  readme: credit @bozaro and @idy (#53)
  Improve cursorData struct unmarshaling speed (#49)
  readme: credit @bozaro (#47)
  Fix GetBSON() method usage (#40)
  readme: credit @feliixx (#46)
  fix golint, go vet and gofmt warnings (#44)
  readme: add missing features / credit
  bson.Unmarshal returns time in UTC (#42)
  Introduce constants for BSON element types (#41)
  Test against MongoDB 3.4.x (#35)
  Add collation option to collection.Create() (#37)
  Don't panic on indexed int64 fields (#23)
  readme: credit @feliixx in the README (#36)
  add method CreateView() (#33)
  Update README to add appName (#32)
  send metadata during handshake (#28)
  readme: credit @feliixx for #25 (#26)
  add DropAllIndexes() method (#25)

# Conflicts:
#	README.md
#	bson/decode.go
  • Loading branch information
domodwyer committed Oct 22, 2017
2 parents 8d9e210 + 0454966 commit e10a339
Show file tree
Hide file tree
Showing 5 changed files with 297 additions and 200 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Further PR's (with tests) are welcome, but please maintain backwards compatibili
* Consistently unmarshal time.Time values as UTC ([details](https://github.com/globalsign/mgo/pull/42))
* Enforces best practise coding guidelines ([details](https://github.com/globalsign/mgo/pull/44))
* GetBSON correctly handles structs with both fields and pointers ([details](https://github.com/globalsign/mgo/pull/40))
* Improved bson.Raw unmarshalling performance ([details](https://github.com/globalsign/mgo/pull/49))
* Minimise socket connection timeouts due to excessive locking ([details](https://github.com/globalsign/mgo/pull/52))

---

Expand All @@ -42,6 +44,7 @@ Further PR's (with tests) are welcome, but please maintain backwards compatibili
* @eaglerayp
* @feliixx
* @fmpwizard
* @idy
* @jameinel
* @gazoon
* @mapete94
Expand Down
13 changes: 13 additions & 0 deletions bson/bson_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ func testUnmarshal(c *C, data string, obj interface{}) {
err := bson.Unmarshal([]byte(data), zero)
c.Assert(err, IsNil)
c.Assert(zero, DeepEquals, obj)

testUnmarshalRawElements(c, []byte(data))
}

func testUnmarshalRawElements(c *C, data []byte) {
elems := []bson.RawDocElem{}
err := bson.Unmarshal(data, &elems)
c.Assert(err, IsNil)
for _, elem := range elems {
if elem.Value.Kind == bson.ElementDocument || elem.Value.Kind == bson.ElementArray {
testUnmarshalRawElements(c, elem.Value.Data)
}
}
}

type testItemType struct {
Expand Down
Loading

0 comments on commit e10a339

Please sign in to comment.