@@ -75,7 +75,7 @@ type BindingError struct {
75
75
}
76
76
77
77
// NewBindingError creates new instance of binding error
78
- func NewBindingError (sourceParam string , values []string , message interface {} , internalError error ) error {
78
+ func NewBindingError (sourceParam string , values []string , message any , internalError error ) error {
79
79
return & BindingError {
80
80
Field : sourceParam ,
81
81
Values : values ,
@@ -103,7 +103,7 @@ type ValueBinder struct {
103
103
// ValuesFunc is used to get all values for parameter from request. i.e. `/api/search?ids=1&ids=2`
104
104
ValuesFunc func (sourceParam string ) []string
105
105
// ErrorFunc is used to create errors. Allows you to use your own error type, that for example marshals to your specific json response
106
- ErrorFunc func (sourceParam string , values []string , message interface {} , internalError error ) error
106
+ ErrorFunc func (sourceParam string , values []string , message any , internalError error ) error
107
107
}
108
108
109
109
// QueryParamsBinder creates query parameter value binder
@@ -403,17 +403,17 @@ func (b *ValueBinder) MustTextUnmarshaler(sourceParam string, dest encoding.Text
403
403
404
404
// BindWithDelimiter binds parameter to destination by suitable conversion function.
405
405
// Delimiter is used before conversion to split parameter value to separate values
406
- func (b * ValueBinder ) BindWithDelimiter (sourceParam string , dest interface {} , delimiter string ) * ValueBinder {
406
+ func (b * ValueBinder ) BindWithDelimiter (sourceParam string , dest any , delimiter string ) * ValueBinder {
407
407
return b .bindWithDelimiter (sourceParam , dest , delimiter , false )
408
408
}
409
409
410
410
// MustBindWithDelimiter requires parameter value to exist to bind destination by suitable conversion function.
411
411
// Delimiter is used before conversion to split parameter value to separate values
412
- func (b * ValueBinder ) MustBindWithDelimiter (sourceParam string , dest interface {} , delimiter string ) * ValueBinder {
412
+ func (b * ValueBinder ) MustBindWithDelimiter (sourceParam string , dest any , delimiter string ) * ValueBinder {
413
413
return b .bindWithDelimiter (sourceParam , dest , delimiter , true )
414
414
}
415
415
416
- func (b * ValueBinder ) bindWithDelimiter (sourceParam string , dest interface {} , delimiter string , valueMustExist bool ) * ValueBinder {
416
+ func (b * ValueBinder ) bindWithDelimiter (sourceParam string , dest any , delimiter string , valueMustExist bool ) * ValueBinder {
417
417
if b .failFast && b .errors != nil {
418
418
return b
419
419
}
@@ -501,7 +501,7 @@ func (b *ValueBinder) MustInt(sourceParam string, dest *int) *ValueBinder {
501
501
return b .intValue (sourceParam , dest , 0 , true )
502
502
}
503
503
504
- func (b * ValueBinder ) intValue (sourceParam string , dest interface {} , bitSize int , valueMustExist bool ) * ValueBinder {
504
+ func (b * ValueBinder ) intValue (sourceParam string , dest any , bitSize int , valueMustExist bool ) * ValueBinder {
505
505
if b .failFast && b .errors != nil {
506
506
return b
507
507
}
@@ -517,7 +517,7 @@ func (b *ValueBinder) intValue(sourceParam string, dest interface{}, bitSize int
517
517
return b .int (sourceParam , value , dest , bitSize )
518
518
}
519
519
520
- func (b * ValueBinder ) int (sourceParam string , value string , dest interface {} , bitSize int ) * ValueBinder {
520
+ func (b * ValueBinder ) int (sourceParam string , value string , dest any , bitSize int ) * ValueBinder {
521
521
n , err := strconv .ParseInt (value , 10 , bitSize )
522
522
if err != nil {
523
523
if bitSize == 0 {
@@ -543,7 +543,7 @@ func (b *ValueBinder) int(sourceParam string, value string, dest interface{}, bi
543
543
return b
544
544
}
545
545
546
- func (b * ValueBinder ) intsValue (sourceParam string , dest interface {} , valueMustExist bool ) * ValueBinder {
546
+ func (b * ValueBinder ) intsValue (sourceParam string , dest any , valueMustExist bool ) * ValueBinder {
547
547
if b .failFast && b .errors != nil {
548
548
return b
549
549
}
@@ -558,7 +558,7 @@ func (b *ValueBinder) intsValue(sourceParam string, dest interface{}, valueMustE
558
558
return b .ints (sourceParam , values , dest )
559
559
}
560
560
561
- func (b * ValueBinder ) ints (sourceParam string , values []string , dest interface {} ) * ValueBinder {
561
+ func (b * ValueBinder ) ints (sourceParam string , values []string , dest any ) * ValueBinder {
562
562
switch d := dest .(type ) {
563
563
case * []int64 :
564
564
tmp := make ([]int64 , len (values ))
@@ -729,7 +729,7 @@ func (b *ValueBinder) MustUint(sourceParam string, dest *uint) *ValueBinder {
729
729
return b .uintValue (sourceParam , dest , 0 , true )
730
730
}
731
731
732
- func (b * ValueBinder ) uintValue (sourceParam string , dest interface {} , bitSize int , valueMustExist bool ) * ValueBinder {
732
+ func (b * ValueBinder ) uintValue (sourceParam string , dest any , bitSize int , valueMustExist bool ) * ValueBinder {
733
733
if b .failFast && b .errors != nil {
734
734
return b
735
735
}
@@ -745,7 +745,7 @@ func (b *ValueBinder) uintValue(sourceParam string, dest interface{}, bitSize in
745
745
return b .uint (sourceParam , value , dest , bitSize )
746
746
}
747
747
748
- func (b * ValueBinder ) uint (sourceParam string , value string , dest interface {} , bitSize int ) * ValueBinder {
748
+ func (b * ValueBinder ) uint (sourceParam string , value string , dest any , bitSize int ) * ValueBinder {
749
749
n , err := strconv .ParseUint (value , 10 , bitSize )
750
750
if err != nil {
751
751
if bitSize == 0 {
@@ -771,7 +771,7 @@ func (b *ValueBinder) uint(sourceParam string, value string, dest interface{}, b
771
771
return b
772
772
}
773
773
774
- func (b * ValueBinder ) uintsValue (sourceParam string , dest interface {} , valueMustExist bool ) * ValueBinder {
774
+ func (b * ValueBinder ) uintsValue (sourceParam string , dest any , valueMustExist bool ) * ValueBinder {
775
775
if b .failFast && b .errors != nil {
776
776
return b
777
777
}
@@ -786,7 +786,7 @@ func (b *ValueBinder) uintsValue(sourceParam string, dest interface{}, valueMust
786
786
return b .uints (sourceParam , values , dest )
787
787
}
788
788
789
- func (b * ValueBinder ) uints (sourceParam string , values []string , dest interface {} ) * ValueBinder {
789
+ func (b * ValueBinder ) uints (sourceParam string , values []string , dest any ) * ValueBinder {
790
790
switch d := dest .(type ) {
791
791
case * []uint64 :
792
792
tmp := make ([]uint64 , len (values ))
@@ -992,7 +992,7 @@ func (b *ValueBinder) MustFloat32(sourceParam string, dest *float32) *ValueBinde
992
992
return b .floatValue (sourceParam , dest , 32 , true )
993
993
}
994
994
995
- func (b * ValueBinder ) floatValue (sourceParam string , dest interface {} , bitSize int , valueMustExist bool ) * ValueBinder {
995
+ func (b * ValueBinder ) floatValue (sourceParam string , dest any , bitSize int , valueMustExist bool ) * ValueBinder {
996
996
if b .failFast && b .errors != nil {
997
997
return b
998
998
}
@@ -1008,7 +1008,7 @@ func (b *ValueBinder) floatValue(sourceParam string, dest interface{}, bitSize i
1008
1008
return b .float (sourceParam , value , dest , bitSize )
1009
1009
}
1010
1010
1011
- func (b * ValueBinder ) float (sourceParam string , value string , dest interface {} , bitSize int ) * ValueBinder {
1011
+ func (b * ValueBinder ) float (sourceParam string , value string , dest any , bitSize int ) * ValueBinder {
1012
1012
n , err := strconv .ParseFloat (value , bitSize )
1013
1013
if err != nil {
1014
1014
b .setError (b .ErrorFunc (sourceParam , []string {value }, fmt .Sprintf ("failed to bind field value to float%v" , bitSize ), err ))
@@ -1024,7 +1024,7 @@ func (b *ValueBinder) float(sourceParam string, value string, dest interface{},
1024
1024
return b
1025
1025
}
1026
1026
1027
- func (b * ValueBinder ) floatsValue (sourceParam string , dest interface {} , valueMustExist bool ) * ValueBinder {
1027
+ func (b * ValueBinder ) floatsValue (sourceParam string , dest any , valueMustExist bool ) * ValueBinder {
1028
1028
if b .failFast && b .errors != nil {
1029
1029
return b
1030
1030
}
@@ -1039,7 +1039,7 @@ func (b *ValueBinder) floatsValue(sourceParam string, dest interface{}, valueMus
1039
1039
return b .floats (sourceParam , values , dest )
1040
1040
}
1041
1041
1042
- func (b * ValueBinder ) floats (sourceParam string , values []string , dest interface {} ) * ValueBinder {
1042
+ func (b * ValueBinder ) floats (sourceParam string , values []string , dest any ) * ValueBinder {
1043
1043
switch d := dest .(type ) {
1044
1044
case * []float64 :
1045
1045
tmp := make ([]float64 , len (values ))
0 commit comments