Commit graph

445 commits

Author SHA1 Message Date
Jed Borovik
5bebd577e0 Scanning nil for null.Time creates value with Valid = false rather than erroring 2015-09-10 12:49:41 -04:00
Jed Borovik
8112aae462 Make null.Time.Scan more robust by returning an error on the wrong type 2015-09-10 10:56:15 -04:00
Greg
95e26ed907 prefer JSON errors when unmarshaling, better docs
Invalid JSON input will return a *json.SyntaxError instead of a cryptic error
from this package.
2015-09-10 20:05:24 +09:00
Jed Borovik
b9afe213ba Add null.Time and testing 2015-09-08 17:28:31 -04:00
Gregory Roseberry
41fe781af5 fix govet warnings 2015-01-28 15:15:30 +09:00
Gregory Roseberry
404a61efa2 improve godoc 2015-01-21 11:33:38 +09:00
Gregory Roseberry
68a803260b overflow and float conversion tests 2014-09-17 10:12:28 +09:00
Greg
49b7edd3ac Merge pull request #5 from hasryan/issue3_intunmarshal_tests
Add tests for non-integer floats being cast to Int silently, and int64 overflows
2014-09-17 10:10:43 +09:00
Ryan LaHue
041ab70863 Add tests for non-integer floats being cast to Int silently, and int64 overflows 2014-09-16 18:05:23 -07:00
Gregory Roseberry
5bc3c32da7 avoid loss of precision in JSON unmarshal 2014-09-17 09:52:39 +09:00
Greg
26b8e82557 Merge pull request #4 from hasryan/issue3_intunmarshal
Avoid intermediate float64 storage for int64s during JSON unmarshal
2014-09-17 09:50:23 +09:00
Ryan LaHue
c0d98407b9 Avoid []byte=>float64=>int64 conversion, instead going directly from []byte=>int64, to avoid issues with intermediate float64 representation 2014-09-16 17:43:59 -07:00
Greg
f565b8c15b Merge pull request #2 from guregu/errors
UnmarshalJSON should return an error for invalid types
2014-09-09 12:33:27 +09:00
Greg
214012c56c UnmarshalJSON returns an error for invalid zero.* types, tests 2014-09-09 12:31:58 +09:00
Greg
b550c62e10 Merge pull request #1 from joelkek/master
UnmarshalJSON should return an error for invalid types
2014-09-09 12:21:16 +09:00
Joel Kek
f5cd2b14cc UnmarshalJSON in null.Bool, null.Float, and null.String now return an error message when asked to unmarshal from an invalid type. This is in line with the behavior of the built-in sql library's null values. 2014-09-09 00:55:40 +08:00
Joel Kek
7cccb14361 UnmarshalJSON in Int now returns an error message when asked to unmarshal from an invalid type. This is in line with the behavior of the built-in sql.NullInt64. 2014-09-09 00:52:08 +08:00
Gregory Roseberry
46b452db55 fix docs 2014-09-03 09:40:33 +09:00
Gregory Roseberry
f97cca7639 fix grammar in godoc 2014-09-02 12:06:29 +09:00
Greg
df97727d47 fix godoc 2014-09-02 09:24:56 +09:00
Greg
146c1112cd tweak godoc 2014-09-02 04:05:20 +09:00
Greg
a99cdf8f98 update docs wording 2014-09-02 03:33:18 +09:00
Greg
49f7d361d6 remove nuller pkg 2014-09-02 03:23:43 +09:00
Greg
406494f0f8 refactor to use package zero instead of null, and null instead of nuller 2014-09-02 03:22:17 +09:00
Gregory Roseberry
53ccf98d65 add gopkg.in import to README 2014-09-01 14:38:26 +09:00
Gregory Roseberry
5cd2a757d8 SetValid() func and bring coverage back up to 100% 2014-09-01 14:25:57 +09:00
Gregory Roseberry
d3f0388e17 add Floats and Bools 2014-09-01 13:46:40 +09:00
Greg
37ad69e8b9 fix godoc 2014-08-31 17:58:34 +09:00
Greg
a0225e0dde tweak godoc 2014-08-31 17:39:31 +09:00
Greg
777d43e8e4 docs formatting 2014-08-31 17:38:25 +09:00
Greg
4ac909cd7c update docs/fix nuller pkg 2014-08-31 17:36:30 +09:00
Greg
bd2ece7042 change README formatting 2014-08-31 17:30:01 +09:00
Greg
b3e13aac8d refactor into 2 packages 2014-08-31 17:28:34 +09:00
Greg
ab8dd4e057 update docs 2014-08-31 00:03:04 +09:00
Greg
9ed047bf7b nullable Int, String improvements 2014-08-30 23:53:25 +09:00
Gregory Roseberry
3f7515f3d4 fix NewString() 2014-08-29 11:31:09 +09:00
Gregory Roseberry
72eabffd9d change test output messages 2014-08-29 11:21:30 +09:00
Gregory Roseberry
064b38ec63 update docs 2014-08-29 11:12:48 +09:00
Gregory Roseberry
8ba2f90d14 IsZero() now returns true if string is valid but blank 2014-08-29 11:09:04 +09:00
Gregory Roseberry
37ab5072cf tweak README 2014-08-29 10:56:24 +09:00
Gregory Roseberry
705af58a4d fancy docs and 100% coverage 2014-08-29 10:50:02 +09:00
Gregory Roseberry
d46826878c docs and tweaks 2014-08-29 10:29:17 +09:00
Greg
95bde34e57 add IsZero()
Go 1.4 will have JSON ,omitempty respect this, maybe.
2014-08-29 00:37:35 +09:00
Greg
cf649e8f2a update tests 2014-08-29 00:13:09 +09:00
Greg
043f53c9b4 initial commit 2014-08-29 00:11:18 +09:00