aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-openapi/errors/middleware.go
diff options
context:
space:
mode:
authortechknowlogick <techknowlogick@gitea.io>2022-01-14 18:16:05 -0500
committerGitHub <noreply@github.com>2022-01-14 18:16:05 -0500
commit84145e45c50130922fae9055535ab5ea0378e1d4 (patch)
treefce077a5ae462840bb876ace79aca42abab29ed7 /vendor/github.com/go-openapi/errors/middleware.go
parent2b16ca7c773de278ba01f122dc6f9f43d7534c52 (diff)
downloadgitea-84145e45c50130922fae9055535ab5ea0378e1d4.tar.gz
gitea-84145e45c50130922fae9055535ab5ea0378e1d4.zip
Remove golang vendored directory (#18277)
* rm go vendor * fix drone yaml * add to gitignore
Diffstat (limited to 'vendor/github.com/go-openapi/errors/middleware.go')
-rw-r--r--vendor/github.com/go-openapi/errors/middleware.go51
1 files changed, 0 insertions, 51 deletions
diff --git a/vendor/github.com/go-openapi/errors/middleware.go b/vendor/github.com/go-openapi/errors/middleware.go
deleted file mode 100644
index c26ad484eb..0000000000
--- a/vendor/github.com/go-openapi/errors/middleware.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package errors
-
-import (
- "bytes"
- "fmt"
- "strings"
-)
-
-// APIVerificationFailed is an error that contains all the missing info for a mismatched section
-// between the api registrations and the api spec
-type APIVerificationFailed struct {
- Section string `json:"section,omitempty"`
- MissingSpecification []string `json:"missingSpecification,omitempty"`
- MissingRegistration []string `json:"missingRegistration,omitempty"`
-}
-
-//
-func (v *APIVerificationFailed) Error() string {
- buf := bytes.NewBuffer(nil)
-
- hasRegMissing := len(v.MissingRegistration) > 0
- hasSpecMissing := len(v.MissingSpecification) > 0
-
- if hasRegMissing {
- buf.WriteString(fmt.Sprintf("missing [%s] %s registrations", strings.Join(v.MissingRegistration, ", "), v.Section))
- }
-
- if hasRegMissing && hasSpecMissing {
- buf.WriteString("\n")
- }
-
- if hasSpecMissing {
- buf.WriteString(fmt.Sprintf("missing from spec file [%s] %s", strings.Join(v.MissingSpecification, ", "), v.Section))
- }
-
- return buf.String()
-}