globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 230 forks source link

Implement encoding.TextMarshaler (and TextUnmarshaler) for Decimal128 #353

Closed yalegko closed 5 years ago

yalegko commented 5 years ago

Currently Decimal128 can't be converted to the JSON directly w/o additional actions.

Implementing encoding.TextMarshaler interface can make a type useful in multiple encodings. Packages that check for these interfaces include encoding/gob, encoding/json, encoding/xml and many other custom ones.

Closes #350

Dragomir-Ivanov commented 5 years ago

Any idea why checks fail?

yalegko commented 5 years ago

No ideas how the change can affect that.

c.Assert(stats.TotalPoolWaitTime > 300*time.Millisecond, Equals, true)

Could it be just a random test lag?

eminano commented 5 years ago

@yalegko and @Dragomir-Ivanov, thanks again both of you for your contribution!