Commit graph

61 commits

Author SHA1 Message Date
Patrick O'brien 593ba42ffa Update license and readme 2016-09-04 19:18:51 +10:00
Patrick O'brien 67ba4e0272 Fix README, fix Valuer methods
* Fix import paths
2016-06-08 13:53:02 +10:00
Patrick O'brien 4f91fe41ce Add all additional types to zero package
* Add all additional float, int and uint types to zero package
* Moved convert to its own package

* Updated README to reflect changes
2016-05-18 17:00:15 +10:00
Patrick O'brien bbb7b84bb6 Add all int and float null types
* Add Scan and Value methods for non sql.Int64 and sql.Float64 types
* Change NullInt to use int in the code opposed to int64
* Rename Float to Float64
* Add support for all missing key int and float types:
  float32, int8, int16, int32, int64, uint8, uint16, uint32, uint64

* Update README to include new additions/changes
2016-05-17 22:02:36 +10:00
Greg 41961cea03 MarshalText for null.String
forgot to add this
2016-02-28 09:53:16 +09:00
Greg aa8aa51503 fix godoc for IsZero
it had the old behavior from v2
2016-02-28 09:32:36 +09:00
Greg 79c5bd36b6 fix README
whoops
2015-10-24 19:10:46 +09:00
Greg 46376a4a3c Merge pull request #11 from justinas/master
Fix a typo in README
2015-10-21 07:28:36 +09:00
Justinas Stankevicius eb7618b4e1 Fix a typo 2015-10-21 01:13:05 +03:00
Greg a9db3ac26f JSON "" shouldn't unmarshal to a null null.String.
That's what the zero package is for.
This was a "feature", but inconsistent with the rest of the null package.
2015-10-02 14:42:03 +09:00
Greg 4ac4f00378 MarshalText, UnmarshalText for Time 2015-09-14 05:33:34 +09:00
Greg e001fb0f0c Time docs, tweaks, tests 2015-09-14 05:07:53 +09:00
Greg e6fc057718 Merge pull request #9 from resonance/master
Add null.Time and testing
2015-09-14 04:03:55 +09:00
Jed Borovik 50fbbe2bd8 Add zero.Time and tests 2015-09-12 20:30:39 -04:00
Jed Borovik 639d4dad0a Minor tweaks to null.Time UnmarshalJSON 2015-09-12 18:48:38 -04:00
Jed Borovik e5f4f566ed Add unmarshalling null.Time from map[string]interface{} 2015-09-10 13:36:31 -04:00
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