Skip to content

Releases: go-carrot/validator

go-carrot/validator v2.0.0

28 Aug 21:28
Compare
Choose a tag to compare

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

29 Jun 17:08
Compare
Choose a tag to compare
  • Fixed a bug that prevented Default value from being used properly in specific cases

go-carrot/validator v1.3.0

23 Jun 21:57
Compare
Choose a tag to compare
  • Adds TypeHandler implementations for github.com/guregu/null
  • Default support for *time.Time

go-carrot/validator v1.2.0

22 Jun 20:29
Compare
Choose a tag to compare
  • Support of arbitrary types, via TypeHandler

go-carrot/validator v1.1.0

06 Jun 14:20
Compare
Choose a tag to compare
  • bug fixes
  • Adds a Default field to values

go-carrot/validator v1.0.0

01 Apr 20:13
Compare
Choose a tag to compare

Initial release