Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update module go-playground/validator to v9 #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Oct 3, 2018

This PR contains the following updates:

Package Type Update Change References
gopkg.in/go-playground/validator.v8 require major v8.18.2 -> v9.24.0 source

Release Notes

go-playground/validator

v9.24.0

Compare Source

What's new?
  • Added URN validation, thanks @​leodido for the PR
  • Added Japanese translations!!! 😍 , thanks @​akm for the PR
What was fixed?
  • Corrected imports in the pt_BR translation, thanks @​AGPDev for the PR
  • Added missing translation for unique validation, thanks @​holyspectral for the PR

v9.23.0

Compare Source

What's new?

v9.22.0

Compare Source

What's new?
  • Added better RegisterTagNameFunc documentation in this PR, thanks @​frou for the PR!
  • Added zh-tw translations in this PR, thanks @​kanozec for the PR!

v9.21.1

Compare Source

What was fixed?

Corrected some documentation in this PR and this PR; thanks @​44px & @​sakura1116vg for the PR's!

v9.21.0

Compare Source

What's new?

Added dutch translations thanks to @​wesselvanderlinden and PR #​387!

v9.20.2

Compare Source

What was fixed?

Corrected language package name thanks @​foolin , wee #​381 for details.

v9.20.1

Compare Source

What was fixed?
  • corrected StructFilteredCtx not passing the context through, thanks @​dvic!, see #​380 for details.

v9.20.0

Compare Source

What's new?

Added Chinese translations, thanks @​foolin! for more details foor #​379

v9.19.0

Compare Source

What's new?

3 new validations added:

html - This validates that a string value appears to be an HTML element tag including those described at https://developer.mozilla.org/en-US/docs/Web/HTML/Element

html_encoded - This validates that a string value is a proper character reference in decimal or hexadecimal format

url_encoded - This validates that a string value is percent-encoded (URL encoded) according to https://tools.ietf.org/html/rfc3986#section-2.1

for details see PR #​377 Thanks @​heatwole for the PR!

v9.17.1

Compare Source

What was fixed

A typo in the documentation, thanks @​tengis617 for the PR

v9.17.0

Compare Source

Expanded numeric & number validations

It was originally intended for these to only be used on strings, however
it makes sense to also use them if you are dealing with type interface{}

So now ints and floats return true for this validation also as they are
both numeric and a number.

v9.16.1

Compare Source

What was fixed?

According to http://www.ietf.org/rfc/rfc1123.txt Hostnames are limited to letters-digits-hyphen, removing underscore as a valid character. see PR #​359 for details. Thanks @​jadhub for the PR! & @​danielpoe for reporting.

v9.16.0

Compare Source

What's new?
  • Update gin upgrade example, see #​358 for details, thanks @​Ashtonian for the PR!
  • Extended the unique tag to also cover map values, see #​361 for details, thanks @​jservice-rvbd for the PR!
  • cleaned up some linting and spelling errors.
    • fixed some translation error checks not propogated found during linting.

v9.15.0

Compare Source

What's new

Add the following new validations:

  • Adds bitcoin address validation for P2PKH and P2SH addresses
  • Adds bitcoin address validation for Bech32 addresses
  • Adds basic ethereum address validation

Thanks @​QuestofIranon for the PR

v9.14.0

Compare Source

What's new?

Added base64url validation according to section 5 of RFC4648 Thanks @​kgeorgiou for the PR!

v9.13.0

Compare Source

What's New?

Added Brazilian Portuguese translations see PR #​350 Thanks @​afranioce

v9.12.0

Compare Source

What's new?
  • French translations were added for error messages thanks to @​fdelbos's PR

v9.11.0

Compare Source

What's new?

added a new validation oneof thanks for the PR @​ansel1

see details in the PR #​343

v9.10.0

Compare Source

What's new?

Added new validation hostname_rfc1123 the current hostname validation is for RFC 952

###I want to use the new hostname validation, but don't want to go around and change my struct tags.
No problem, just register an Alias eg.

validate := validator.New()
validate.RegisterAlias("hostname", "hostname_rfc1123")

v9.9.4

Compare Source

What was fixed?

  • Corrected docs for method name change FieldWithValue => VarWithValue
  • Corrected display of translations when field is relfect.Ptr thanks @​glb see #​340

v9.9.3

Compare Source

What was fixed?

Update tagCache locking scope to allow for validate.Var and validate.VarCtx to be used from within validations functions. see #​335 for details.

v9.9.2

Compare Source

What was fixed/updated?

Updated docs to clarify between validation tag separator or , and or validation tag separator |

v9.9.1

Compare Source

What was fixed?

There was an issue checking for the end of an or validation block and when 2 consecutive or validation blocks existed, it would not return an error or return an incorrect error.

NOTE: This bug only affected validation with consecutive or validation blocks eg.

validate:"tag1|tag2=,tag3|tag4"

block1 = tag1|tag2=
block2 = tag3|tag4

Thanks for reporting the issue @​skryja, see #​329 for more details

v9.9.0

Compare Source

What's new?

Added map key validation support with new keys and endkeys eg.

type Test struct {
  Map map[string]string `validate:"dive,keys,trim,endkeys,trim"`
}

keys must be directly after the dive tag; this was done for efficiency to allow map keys and values to be be handled within the same range.

see docs for more details.

v9.8.0

Compare Source

What was added?

Added unique validation for ensuring array|slice contain unique values.

v9.7.0

Compare Source

Whats New?

Added new isdefault tag, essentially it's the opposite of required and only intended for specific use cases. See #​299 for more details.

What was fixed?

Corrected error in fqdn when value is blank, see #​306 for more details.

v9.6.0

Compare Source

What's new?

Added hostname and fqdn validations thanks to @​senuphtyz and PR #​298

v9.5.0

Compare Source

What new?

Added contextual validation support via context.Context: thanks to @​thaonx @​nuxier and PR #​292

  • RegisterValidationCtx(...)
  • RegisterStructValidationCtx(...)
  • StructCtx(...)
  • StructFilteredCtx(...)
  • StructPartialCtx(...)
  • StructExceptCtx(...)
  • VarCtx(...)
  • VarWithValueCtx(...)

NOTE: in v10 release all old methods will be removed and only new Context methods will remain.

v9.4.0

Compare Source

What's new?
  • Add Access to Field Name from FieldLevel interface via FieldLevel.FieldName() and FieldLevel.StructFieldName()
  • Renamed examples directory to _examples to avoid any potential dependencies in examples being pulled in by go tools.

v9.3.6

Compare Source

What was fixed?

  • Some more typos in the documentation.
  • Updated README to fix rendering issue with GitHub's new markdown parser.

v9.3.5

Compare Source

What was fixed?
  • Corrected some typos in README which Fixes #​273
  • updated lint issue in one of the tests
  • Updated Benchmarks for Go 1.8

v9.3.4

Compare Source

What was fixed?

no issues with validator, just updating test.

  • Updated failing test for new translation error message.
  • Updated benchmarks with my new dev machine at the same time.

v9.3.3

Compare Source

What was fixed?

v9.3.2

Compare Source

What was fixed?

Corrected Namespace issue when a field within an array or map of structs causes an error, see #​266

Thanks @​cbandy for reporting!

v9.3.1

Compare Source

What was fixed?

structonly did not behave as expected when not accompanied by a struct validation thanks @​thessem for reporting in #​264 😄

v9.3.0

Compare Source

What was added?
  • added alphaunicode and alphanumunicode validations which are basically just unicode variants of the alpha and alphanum validations that were ASCII only.

relates to #​261

v9.2.2

Compare Source

What was fixed

update cached fields to be stored in array instead of map for #​260 thanks @​jonmchan for reporting

  • errors now always print out in order for tests
  • performance enhancement from array vs map is nice too ;)
benchmark                                                       old ns/op     new ns/op     delta
BenchmarkFieldSuccess-8                                         101           100           -0.99%
BenchmarkFieldSuccessParallel-8                                 33.2          33.7          +1.51%
BenchmarkFieldFailure-8                                         323           332           +2.79%
BenchmarkFieldFailureParallel-8                                 112           113           +0.89%
BenchmarkFieldDiveSuccess-8                                     719           714           -0.70%
BenchmarkFieldDiveSuccessParallel-8                             230           225           -2.17%
BenchmarkFieldDiveFailure-8                                     1001          987           -1.40%
BenchmarkFieldDiveFailureParallel-8                             323           317           -1.86%
BenchmarkFieldCustomTypeSuccess-8                               263           264           +0.38%
BenchmarkFieldCustomTypeSuccessParallel-8                       82.6          81.4          -1.45%
BenchmarkFieldCustomTypeFailure-8                               327           328           +0.31%
BenchmarkFieldCustomTypeFailureParallel-8                       116           116           +0.00%
BenchmarkFieldOrTagSuccess-8                                    871           878           +0.80%
BenchmarkFieldOrTagSuccessParallel-8                            394           402           +2.03%
BenchmarkFieldOrTagFailure-8                                    568           569           +0.18%
BenchmarkFieldOrTagFailureParallel-8                            397           401           +1.01%
BenchmarkStructLevelValidationSuccess-8                         332           267           -19.58%
BenchmarkStructLevelValidationSuccessParallel-8                 105           82.4          -21.52%
BenchmarkStructLevelValidationFailure-8                         637           557           -12.56%
BenchmarkStructLevelValidationFailureParallel-8                 260           226           -13.08%
BenchmarkStructSimpleCustomTypeSuccess-8                        525           452           -13.90%
BenchmarkStructSimpleCustomTypeSuccessParallel-8                155           144           -7.10%
BenchmarkStructSimpleCustomTypeFailure-8                        828           738           -10.87%
BenchmarkStructSimpleCustomTypeFailureParallel-8                345           285           -17.39%
BenchmarkStructFilteredSuccess-8                                744           664           -10.75%
BenchmarkStructFilteredSuccessParallel-8                        274           257           -6.20%
BenchmarkStructFilteredFailure-8                                595           517           -13.11%
BenchmarkStructFilteredFailureParallel-8                        250           195           -22.00%
BenchmarkStructPartialSuccess-8                                 674           608           -9.79%
BenchmarkStructPartialSuccessParallel-8                         256           225           -12.11%
BenchmarkStructPartialFailure-8                                 928           848           -8.62%
BenchmarkStructPartialFailureParallel-8                         399           360           -9.77%
BenchmarkStructExceptSuccess-8                                  1076          934           -13.20%
BenchmarkStructExceptSuccessParallel-8                          237           200           -15.61%
BenchmarkStructExceptFailure-8                                  873           787           -9.85%
BenchmarkStructExceptFailureParallel-8                          365           333           -8.77%
BenchmarkStructSimpleCrossFieldSuccess-8                        539           489           -9.28%
BenchmarkStructSimpleCrossFieldSuccessParallel-8                201           168           -16.42%
BenchmarkStructSimpleCrossFieldFailure-8                        788           709           -10.03%
BenchmarkStructSimpleCrossFieldFailureParallel-8                322           299           -7.14%
BenchmarkStructSimpleCrossStructCrossFieldSuccess-8             795           683           -14.09%
BenchmarkStructSimpleCrossStructCrossFieldSuccessParallel-8     241           211           -12.45%
BenchmarkStructSimpleCrossStructCrossFieldFailure-8             1110          940           -15.32%
BenchmarkStructSimpleCrossStructCrossFieldFailureParallel-8     399           333           -16.54%
BenchmarkStructSimpleSuccess-8                                  367           285           -22.34%
BenchmarkStructSimpleSuccessParallel-8                          108           91.0          -15.74%
BenchmarkStructSimpleFailure-8                                  776           698           -10.05%
BenchmarkStructSimpleFailureParallel-8                          307           284           -7.49%
BenchmarkStructComplexSuccess-8                                 2224          1622          -27.07%
BenchmarkStructComplexSuccessParallel-8                         718           526           -26.74%
BenchmarkStructComplexFailure-8                                 5350          4717          -11.83%
BenchmarkStructComplexFailureParallel-8                         2097          1853          -11.64%

v9.2.1

Compare Source

What was fixed?

The required tag was not correctly validating pointer fields like the old v8 exists tag ( see issue #​142 ) was and so that bug has been corrected. thanks @​codepushr for reporting

  • added required tag to the restricted tags that cannot be overridden because of it's dual functionality with pointers ( thought it already was, my mistake )

v9.2.0

Compare Source

What's new?

Added StructFiltered(s interface{}, fn FilterFunc) function to allow for better filtering of fields besides StructPartial or StructExcept for #​255

thanks @​jawher for the idea

v9.1.3

Compare Source

What was fixed?

Explicitly qualify universal-translator imports; thanks @​jawher

v9.1.2

Compare Source

What was fixed?
  • accidentally cut a release before changes were pushed, fix release for v9.1.1; apologies for the noise.

v9.1.1

Compare Source

What was fixed?
  • added missing iscolor alias translation
  • correct 2 issues with or's
    • param wasn't being set on the returned or tag eg. rgb|rgba|len=10 was missing the =10 when reporting the tag in error
    • corrected issue when tags may exist past the or's as a double check, nobody has ever run into this but I did adding some new functionality not yet released, and wanted to add it in now for the future.

v9.1.0

Compare Source

What's New?

🎉 This change has been a long time coming 🎉

The story so far....

A long time ago in a validator package on a github server far far away...

A request was made for allowing custom validations #​174 but the evil i18n,

localization of errors, stood in our way #​230. An expedition was dispatched to

search the vastness open source, but alas no suitable i18n package with correct

pluralization rules could be found; the outlook for validator seemed grim; until a

developer created an i18n and l10n helper package locales and an i18n package

universal-translator that wraps it and then jammed that functionality deep inside of validator!

So without further ado:
  • Added i18n aware Custom Error Message translations see here for an example
    • Custom Translation can be registered using RegisterTranslation
    • A Default set of translations exists for the en locale here; if anyone could help in adding more for other locales that would be appreciated 😄

v9.0.0

Compare Source

Release 9.0.0

After much work, tweaking and design updates validator v9 has been released!

It's even faster, more efficient and built for ease of use!

Quick overview of changes

documentation has been updated to reflect all of these changes, see them for more details.

  • ValidationErrors is now an []FieldError instead of a map as before.
  • exists tag has been removed, now required tag handles pointer values as well.
  • Much of the design has been updated to use interfaces allowing for even less breaking changes going forward, including FieldError.
  • change name for validating individual fields, I think that some people were associating validation using validate.Field or validate.FieldWithValue to a struct field only, but that is not the case, any variable can be validated and so the functions have been changed to:
var age int

err := validate.Var(age, "gte=0,lte=130")

var parentsAge int

err := validate.VarWithValue(age, parentsAge, "ltcsfield")

// side note: reason validator doesn't have strict sanitizers like IsEmail(..) bool is so many validation can be run  on a field in one run eg.

var settings []string

// this will validate that settings exists, there is at least one entry in array 
// and that each string within the array is set...
validate.Var(settings, "required,gte=1,dive,required")
  • can register any custom tag name function instead of before having to specify the name of the tag...
validate.RegisterTagNameFunc(func(fld reflect.StructField) string {
    name := strings.SplitN(fld.Tag.Get("json"), ",", 2)[0]

    if name == "-" {
        return ""
    }

    return name
})
  • Validation function + Struct Level validation function signatures have changed to use interface and should be infinity easier to remember and implement:
// field level validation func
type Func func(fl FieldLevel) bool

// struct level validation func
type StructLevelFunc func(sl StructLevel)
And now what veryone wants to see, benchmarks compared to v8
benchmark                                               old ns/op     new ns/op     delta
BenchmarkFieldSuccess-8                                 118           108           -8.47%
BenchmarkFieldFailure-8                                 758           320           -57.78%
BenchmarkFieldDiveSuccess-8                             2471          726           -70.62%
BenchmarkFieldDiveFailure-8                             3172          939           -70.40%
BenchmarkFieldCustomTypeSuccess-8                       300           268           -10.67%
BenchmarkFieldCustomTypeFailure-8                       775           310           -60.00%
BenchmarkFieldOrTagSuccess-8                            1122          889           -20.77%
BenchmarkFieldOrTagFailure-8                            1167          546           -53.21%
BenchmarkStructLevelValidationSuccess-8                 548           336           -38.69%
BenchmarkStructLevelValidationFailure-8                 558           611           +9.50%
BenchmarkStructSimpleCustomTypeSuccess-8                623           555           -10.91%
BenchmarkStructSimpleCustomTypeFailure-8                1381          811           -41.27%
BenchmarkStructPartialSuccess-8                         1036          676           -34.75%
BenchmarkStructPartialFailure-8                         1734          1001          -42.27%
BenchmarkStructExceptSuccess-8                          888           1038          +16.89%
BenchmarkStructExceptFailure-8                          1036          863           -16.70%
BenchmarkStructSimpleCrossFieldSuccess-8                773           549           -28.98%
BenchmarkStructSimpleCrossFieldFailure-8                1487          783           -47.34%
BenchmarkStructSimpleCrossStructCrossFieldSuccess-8     1261          837           -33.62%
BenchmarkStructSimpleCrossStructCrossFieldFailure-8     2055          1110          -45.99%
BenchmarkStructSimpleSuccess-8                          519           380           -26.78%
BenchmarkStructSimpleFailure-8                          1429          760           -46.82%
BenchmarkStructSimpleSuccessParallel-8                  146           114           -21.92%
BenchmarkStructSimpleFailureParallel-8                  551           353           -35.93%
BenchmarkStructComplexSuccess-8                         3269          2100          -35.76%
BenchmarkStructComplexFailure-8                         8436          5080          -39.78%
BenchmarkStructComplexSuccessParallel-8                 1024          662           -35.35%
BenchmarkStructComplexFailureParallel-8                 3536          2159          -38.94%

benchmark                                               old allocs     new allocs     delta
BenchmarkFieldSuccess-8                                 0              0              +0.00%
BenchmarkFieldFailure-8                                 4              4              +0.00%
BenchmarkFieldDiveSuccess-8                             28             11             -60.71%
BenchmarkFieldDiveFailure-8                             32             16             -50.00%
BenchmarkFieldCustomTypeSuccess-8                       2              2              +0.00%
BenchmarkFieldCustomTypeFailure-8                       4              4              +0.00%
BenchmarkFieldOrTagSuccess-8                            1              1              +0.00%
BenchmarkFieldOrTagFailure-8                            6              5              -16.67%
BenchmarkStructLevelValidationSuccess-8                 5              2              -60.00%
BenchmarkStructLevelValidationFailure-8                 5              8              +60.00%
BenchmarkStructSimpleCustomTypeSuccess-8                3              2              -33.33%
BenchmarkStructSimpleCustomTypeFailure-8                9              9              +0.00%
BenchmarkStructPartialSuccess-8                         9              6              -33.33%
BenchmarkStructPartialFailure-8                         14             11             -21.43%
BenchmarkStructExceptSuccess-8                          7              12             +71.43%
BenchmarkStructExceptFailure-8                          9              10             +11.11%
BenchmarkStructSimpleCrossFieldSuccess-8                4              3              -25.00%
BenchmarkStructSimpleCrossFieldFailure-8                9              8              -11.11%
BenchmarkStructSimpleCrossStructCrossFieldSuccess-8     7              4              -42.86%
BenchmarkStructSimpleCrossStructCrossFieldFailure-8     12             9              -25.00%
BenchmarkStructSimpleSuccess-8                          1              0              -100.00%
BenchmarkStructSimpleFailure-8                          9              9              +0.00%
BenchmarkStructSimpleSuccessParallel-8                  1              0              -100.00%
BenchmarkStructSimpleFailureParallel-8                  9              9              +0.00%
BenchmarkStructComplexSuccess-8                         15             8              -46.67%
BenchmarkStructComplexFailure-8                         60             53             -11.67%
BenchmarkStructComplexSuccessParallel-8                 15             8              -46.67%
BenchmarkStructComplexFailureParallel-8                 60             53             -11.67%

benchmark                                               old bytes     new bytes     delta
BenchmarkFieldSuccess-8                                 0             0             +0.00%
BenchmarkFieldFailure-8                                 432           192           -55.56%
BenchmarkFieldDiveSuccess-8                             464           201           -56.68%
BenchmarkFieldDiveFailure-8                             896           396           -55.80%
BenchmarkFieldCustomTypeSuccess-8                       32            32            +0.00%
BenchmarkFieldCustomTypeFailure-8                       432           192           -55.56%
BenchmarkFieldOrTagSuccess-8                            4             16            +300.00%
BenchmarkFieldOrTagFailure-8                            448           208           -53.57%
BenchmarkStructLevelValidationSuccess-8                 160           32            -80.00%
BenchmarkStructLevelValidationFailure-8                 160           288           +80.00%
BenchmarkStructSimpleCustomTypeSuccess-8                36            32            -11.11%
BenchmarkStructSimpleCustomTypeFailure-8                640           392           -38.75%
BenchmarkStructPartialSuccess-8                         272           256           -5.88%
BenchmarkStructPartialFailure-8                         730           464           -36.44%
BenchmarkStructExceptSuccess-8                          250           480           +92.00%
BenchmarkStructExceptFailure-8                          272           448           +64.71%
BenchmarkStructSimpleCrossFieldSuccess-8                80            72            -10.00%
BenchmarkStructSimpleCrossFieldFailure-8                536           288           -46.27%
BenchmarkStructSimpleCrossStructCrossFieldSuccess-8     112           80            -28.57%
BenchmarkStructSimpleCrossStructCrossFieldFailure-8     576           304           -47.22%
BenchmarkStructSimpleSuccess-8                          4             0             -100.00%
BenchmarkStructSimpleFailure-8                          640           392           -38.75%
BenchmarkStructSimpleSuccessParallel-8                  4             0             -100.00%
BenchmarkStructSimpleFailureParallel-8                  640           392           -38.75%
BenchmarkStructComplexSuccess-8                         244           128           -47.54%
BenchmarkStructComplexFailure-8                         3609          2833          -21.50%
BenchmarkStructComplexSuccessParallel-8                 244           128           -47.54%
BenchmarkStructComplexFailureParallel-8                 3609          2833          -21.50%

Renovate configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻️ Rebasing: Whenever PR becomes conflicted, or if you modify the PR title to begin with "rebase!".

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot. View repository job log here.

@renovate renovate bot force-pushed the renovate/gopkg.in-go-playground-validator.v8-9.x branch 30 times, most recently from e0429fc to 0fd6610 Compare October 6, 2018 10:49
@renovate renovate bot force-pushed the renovate/gopkg.in-go-playground-validator.v8-9.x branch 28 times, most recently from 2c13464 to fae32bc Compare January 4, 2019 08:47
@renovate renovate bot force-pushed the renovate/gopkg.in-go-playground-validator.v8-9.x branch from fae32bc to 2994b98 Compare January 4, 2019 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants