mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-03 19:00:05 -06:00
build(deps): bump github.com/go-playground/validator/v10
Bumps [github.com/go-playground/validator/v10](https://github.com/go-playground/validator) from 10.18.0 to 10.19.0. - [Release notes](https://github.com/go-playground/validator/releases) - [Commits](https://github.com/go-playground/validator/compare/v10.18.0...v10.19.0) --- updated-dependencies: - dependency-name: github.com/go-playground/validator/v10 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
Ralf Haferkamp
parent
7611f70dc5
commit
65f77c2aa0
2
go.mod
2
go.mod
@@ -41,7 +41,7 @@ require (
|
||||
github.com/go-micro/plugins/v4/wrapper/monitoring/prometheus v1.2.0
|
||||
github.com/go-micro/plugins/v4/wrapper/trace/opentelemetry v1.2.0
|
||||
github.com/go-ozzo/ozzo-validation/v4 v4.3.0
|
||||
github.com/go-playground/validator/v10 v10.18.0
|
||||
github.com/go-playground/validator/v10 v10.19.0
|
||||
github.com/gofrs/uuid v4.4.0+incompatible
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0
|
||||
github.com/golang/protobuf v1.5.3
|
||||
|
||||
4
go.sum
4
go.sum
@@ -1236,8 +1236,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
|
||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||
github.com/go-playground/validator/v10 v10.18.0 h1:BvolUXjp4zuvkZ5YN5t7ebzbhlUtPsPm2S9NAZ5nl9U=
|
||||
github.com/go-playground/validator/v10 v10.18.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
|
||||
github.com/go-playground/validator/v10 v10.19.0 h1:ol+5Fu+cSq9JD7SoSqe04GMI92cbn0+wvQ3bZ8b/AU4=
|
||||
github.com/go-playground/validator/v10 v10.19.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
|
||||
github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
|
||||
github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
|
||||
github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8=
|
||||
|
||||
2
vendor/github.com/go-playground/validator/v10/Makefile
generated
vendored
2
vendor/github.com/go-playground/validator/v10/Makefile
generated
vendored
@@ -15,4 +15,4 @@ test:
|
||||
bench:
|
||||
$(GOCMD) test -run=NONE -bench=. -benchmem ./...
|
||||
|
||||
.PHONY: test lint linters-install
|
||||
.PHONY: test lint linters-install
|
||||
|
||||
2
vendor/github.com/go-playground/validator/v10/README.md
generated
vendored
2
vendor/github.com/go-playground/validator/v10/README.md
generated
vendored
@@ -1,7 +1,7 @@
|
||||
Package validator
|
||||
=================
|
||||
<img align="right" src="logo.png">[](https://gitter.im/go-playground/validator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||

|
||||

|
||||
[](https://travis-ci.org/go-playground/validator)
|
||||
[](https://coveralls.io/github/go-playground/validator?branch=master)
|
||||
[](https://goreportcard.com/report/github.com/go-playground/validator)
|
||||
|
||||
2
vendor/github.com/go-playground/validator/v10/cache.go
generated
vendored
2
vendor/github.com/go-playground/validator/v10/cache.go
generated
vendored
@@ -126,7 +126,7 @@ func (v *Validate) extractStructCache(current reflect.Value, sName string) *cStr
|
||||
|
||||
fld = typ.Field(i)
|
||||
|
||||
if !fld.Anonymous && len(fld.PkgPath) > 0 {
|
||||
if !v.privateFieldValidation && !fld.Anonymous && len(fld.PkgPath) > 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
10
vendor/github.com/go-playground/validator/v10/options.go
generated
vendored
10
vendor/github.com/go-playground/validator/v10/options.go
generated
vendored
@@ -14,3 +14,13 @@ func WithRequiredStructEnabled() Option {
|
||||
v.requiredStructEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
// WithPrivateFieldValidation activates validation for unexported fields via the use of the `unsafe` package.
|
||||
//
|
||||
// By opting into this feature you are acknowledging that you are aware of the risks and accept any current or future
|
||||
// consequences of using this feature.
|
||||
func WithPrivateFieldValidation() Option {
|
||||
return func(v *Validate) {
|
||||
v.privateFieldValidation = true
|
||||
}
|
||||
}
|
||||
|
||||
32
vendor/github.com/go-playground/validator/v10/validator.go
generated
vendored
32
vendor/github.com/go-playground/validator/v10/validator.go
generated
vendored
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// per validate construct
|
||||
@@ -156,7 +157,7 @@ func (v *validate) traverseField(ctx context.Context, parent reflect.Value, curr
|
||||
structNs: v.str2,
|
||||
fieldLen: uint8(len(cf.altName)),
|
||||
structfieldLen: uint8(len(cf.name)),
|
||||
value: current.Interface(),
|
||||
value: getValue(current),
|
||||
param: ct.param,
|
||||
kind: kind,
|
||||
typ: current.Type(),
|
||||
@@ -410,7 +411,7 @@ OUTER:
|
||||
structNs: v.str2,
|
||||
fieldLen: uint8(len(cf.altName)),
|
||||
structfieldLen: uint8(len(cf.name)),
|
||||
value: current.Interface(),
|
||||
value: getValue(current),
|
||||
param: ct.param,
|
||||
kind: kind,
|
||||
typ: typ,
|
||||
@@ -430,7 +431,7 @@ OUTER:
|
||||
structNs: v.str2,
|
||||
fieldLen: uint8(len(cf.altName)),
|
||||
structfieldLen: uint8(len(cf.name)),
|
||||
value: current.Interface(),
|
||||
value: getValue(current),
|
||||
param: ct.param,
|
||||
kind: kind,
|
||||
typ: typ,
|
||||
@@ -470,7 +471,7 @@ OUTER:
|
||||
structNs: v.str2,
|
||||
fieldLen: uint8(len(cf.altName)),
|
||||
structfieldLen: uint8(len(cf.name)),
|
||||
value: current.Interface(),
|
||||
value: getValue(current),
|
||||
param: ct.param,
|
||||
kind: kind,
|
||||
typ: typ,
|
||||
@@ -484,3 +485,26 @@ OUTER:
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func getValue(val reflect.Value) interface{} {
|
||||
if val.CanInterface() {
|
||||
return val.Interface()
|
||||
}
|
||||
|
||||
if val.CanAddr() {
|
||||
return reflect.NewAt(val.Type(), unsafe.Pointer(val.UnsafeAddr())).Elem().Interface()
|
||||
}
|
||||
|
||||
switch val.Kind() {
|
||||
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
||||
return val.Int()
|
||||
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
||||
return val.Uint()
|
||||
case reflect.Complex64, reflect.Complex128:
|
||||
return val.Complex()
|
||||
case reflect.Float32, reflect.Float64:
|
||||
return val.Float()
|
||||
default:
|
||||
return val.String()
|
||||
}
|
||||
}
|
||||
|
||||
29
vendor/github.com/go-playground/validator/v10/validator_instance.go
generated
vendored
29
vendor/github.com/go-playground/validator/v10/validator_instance.go
generated
vendored
@@ -80,20 +80,21 @@ type internalValidationFuncWrapper struct {
|
||||
|
||||
// Validate contains the validator settings and cache
|
||||
type Validate struct {
|
||||
tagName string
|
||||
pool *sync.Pool
|
||||
tagNameFunc TagNameFunc
|
||||
structLevelFuncs map[reflect.Type]StructLevelFuncCtx
|
||||
customFuncs map[reflect.Type]CustomTypeFunc
|
||||
aliases map[string]string
|
||||
validations map[string]internalValidationFuncWrapper
|
||||
transTagFunc map[ut.Translator]map[string]TranslationFunc // map[<locale>]map[<tag>]TranslationFunc
|
||||
rules map[reflect.Type]map[string]string
|
||||
tagCache *tagCache
|
||||
structCache *structCache
|
||||
hasCustomFuncs bool
|
||||
hasTagNameFunc bool
|
||||
requiredStructEnabled bool
|
||||
tagName string
|
||||
pool *sync.Pool
|
||||
tagNameFunc TagNameFunc
|
||||
structLevelFuncs map[reflect.Type]StructLevelFuncCtx
|
||||
customFuncs map[reflect.Type]CustomTypeFunc
|
||||
aliases map[string]string
|
||||
validations map[string]internalValidationFuncWrapper
|
||||
transTagFunc map[ut.Translator]map[string]TranslationFunc // map[<locale>]map[<tag>]TranslationFunc
|
||||
rules map[reflect.Type]map[string]string
|
||||
tagCache *tagCache
|
||||
structCache *structCache
|
||||
hasCustomFuncs bool
|
||||
hasTagNameFunc bool
|
||||
requiredStructEnabled bool
|
||||
privateFieldValidation bool
|
||||
}
|
||||
|
||||
// New returns a new instance of 'validate' with sane defaults.
|
||||
|
||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -979,7 +979,7 @@ github.com/go-playground/locales/en
|
||||
# github.com/go-playground/universal-translator v0.18.1
|
||||
## explicit; go 1.18
|
||||
github.com/go-playground/universal-translator
|
||||
# github.com/go-playground/validator/v10 v10.18.0
|
||||
# github.com/go-playground/validator/v10 v10.19.0
|
||||
## explicit; go 1.18
|
||||
github.com/go-playground/validator/v10
|
||||
github.com/go-playground/validator/v10/translations/en
|
||||
|
||||
Reference in New Issue
Block a user