Releases: go-carrot/validator
Releases · go-carrot/validator
go-carrot/validator v2.0.0
Now with the introduction of easy https://github.com/guregu/null support into this project, I've found the need to want to set a value null.
In the context of a API, I want to be able to send an empty parameter to denote a null value.
This will now yield an error (where it didn't prior to this version):
var name string
err := Validate([]*Value{
{Result: &name, Name: "name", Input: ""},
})
// err != nil
If you intend to allow nullable values in a validation, you will now have to use the respective null.* value.
var name null.String
err := Validate([]*Value{
{Result: &name, Name: "name", Input: ""},
})
// err == nil
Also, in this version bump, null values are automatically applied their TypeHandler (so no need to specify it manually anymore).
Also worth noting, that this library uses and expects https://gopkg.in/guregu/null.v3
go-carrot/validator v1.3.1
- Fixed a bug that prevented
Default
value from being used properly in specific cases
go-carrot/validator v1.3.0
- Adds
TypeHandler
implementations forgithub.com/guregu/null
- Default support for
*time.Time
go-carrot/validator v1.2.0
- Support of arbitrary types, via
TypeHandler
go-carrot/validator v1.1.0
- bug fixes
- Adds a Default field to values
go-carrot/validator v1.0.0
Initial release