summaryrefslogtreecommitdiff
path: root/vendor/github.com/gin-gonic/gin/errors.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/gin-gonic/gin/errors.go')
-rw-r--r--vendor/github.com/gin-gonic/gin/errors.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/vendor/github.com/gin-gonic/gin/errors.go b/vendor/github.com/gin-gonic/gin/errors.go
index 0f276c13d..2853ce8ed 100644
--- a/vendor/github.com/gin-gonic/gin/errors.go
+++ b/vendor/github.com/gin-gonic/gin/errors.go
@@ -1,4 +1,4 @@
-// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
+// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
@@ -34,7 +34,7 @@ const (
type Error struct {
Err error
Type ErrorType
- Meta interface{}
+ Meta any
}
type errorMsgs []*Error
@@ -48,13 +48,13 @@ func (msg *Error) SetType(flags ErrorType) *Error {
}
// SetMeta sets the error's meta data.
-func (msg *Error) SetMeta(data interface{}) *Error {
+func (msg *Error) SetMeta(data any) *Error {
msg.Meta = data
return msg
}
// JSON creates a properly formatted JSON
-func (msg *Error) JSON() interface{} {
+func (msg *Error) JSON() any {
jsonData := H{}
if msg.Meta != nil {
value := reflect.ValueOf(msg.Meta)
@@ -122,7 +122,7 @@ func (a errorMsgs) Last() *Error {
return nil
}
-// Errors returns an array will all the error messages.
+// Errors returns an array with all the error messages.
// Example:
// c.Error(errors.New("first"))
// c.Error(errors.New("second"))
@@ -139,14 +139,14 @@ func (a errorMsgs) Errors() []string {
return errorStrings
}
-func (a errorMsgs) JSON() interface{} {
+func (a errorMsgs) JSON() any {
switch length := len(a); length {
case 0:
return nil
case 1:
return a.Last().JSON()
default:
- jsonData := make([]interface{}, length)
+ jsonData := make([]any, length)
for i, err := range a {
jsonData[i] = err.JSON()
}