gody v2.2.0 Release Notes

Release Date: 2020-11-30 // 11 months ago
  • ๐Ÿ”„ Changed structure for module version

    commit b12bd3f


Previous changes from v2.0.0

  • Validator struct

    • Validate more clean for source code

      validator := gody.NewValidator()if validated, err := validator.Validate(/*struct*/); err != nil { ... }

    • On demand rules

      ...if err := validator.AddRules(/*...rules*/); err != nil { ... } ...

    • ๐Ÿ‘ Support for set a custom tag name

      ...if err := validator.SetTagName(/*name*/); err != nil { ... } ...

    ๐Ÿ‘ Raw functions support

    • RawSerialize receive tag name and the struct to validate.

      func RawSerialize(tn string, b interface{}) ([]Field, error)

    • RawValidate receive the struct to validate, tag name and custom rules.

      func RawValidate(b interface{}, tn string, rules []Rule) (bool, error)

    • 0๏ธโƒฃ RawDefaultValidate receive the struct to validate, tag name and custom rules.

      func RawDefaultValidate(b interface{}, tn string, rules []Rule) (bool, error)

    ๐Ÿฑ > ๐Ÿ““ DefaultValidate and RawDefaultValidate it's same, both uses as default rules built-in gody.

    โœ‚ Remove the necessity for tag in struct and slice validation

    issue #9