summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-openapi/validate/formats.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-09-01 16:01:23 +0200
committerGitHub <noreply@github.com>2020-09-01 10:01:23 -0400
commit3270e7a4435fceb757728dfc319fc04077a37caf (patch)
tree60dcaf02442e930c0b2c7bd7fe0f0b00190a402f /vendor/github.com/go-openapi/validate/formats.go
parent66843f22375b67a58746dac508b71200a96e68d6 (diff)
downloadgitea-3270e7a4435fceb757728dfc319fc04077a37caf.tar.gz
gitea-3270e7a4435fceb757728dfc319fc04077a37caf.zip
[Vendor] update go-swagger v0.21.0 -> v0.25.0 (#12670)
* Update go-swagger * vendor
Diffstat (limited to 'vendor/github.com/go-openapi/validate/formats.go')
-rw-r--r--vendor/github.com/go-openapi/validate/formats.go14
1 files changed, 5 insertions, 9 deletions
diff --git a/vendor/github.com/go-openapi/validate/formats.go b/vendor/github.com/go-openapi/validate/formats.go
index b7afe981bc..0ad996cbbc 100644
--- a/vendor/github.com/go-openapi/validate/formats.go
+++ b/vendor/github.com/go-openapi/validate/formats.go
@@ -37,19 +37,15 @@ func (f *formatValidator) Applies(source interface{}, kind reflect.Kind) bool {
if source == nil {
return false
}
- switch source.(type) {
+ switch source := source.(type) {
case *spec.Items:
- it := source.(*spec.Items)
- return kind == reflect.String && f.KnownFormats.ContainsName(it.Format)
+ return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
case *spec.Parameter:
- par := source.(*spec.Parameter)
- return kind == reflect.String && f.KnownFormats.ContainsName(par.Format)
+ return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
case *spec.Schema:
- sch := source.(*spec.Schema)
- return kind == reflect.String && f.KnownFormats.ContainsName(sch.Format)
+ return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
case *spec.Header:
- hdr := source.(*spec.Header)
- return kind == reflect.String && f.KnownFormats.ContainsName(hdr.Format)
+ return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
}
return false
}