@@ -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 ,
@@ -99,7 +99,7 @@ type ValueBinder struct {
99
99
// ValuesFunc is used to get all values for parameter from request. i.e. `/api/search?ids=1&ids=2`
100
100
ValuesFunc func (sourceParam string ) []string
101
101
// ErrorFunc is used to create errors. Allows you to use your own error type, that for example marshals to your specific json response
102
- ErrorFunc func (sourceParam string , values []string , message interface {} , internalError error ) error
102
+ ErrorFunc func (sourceParam string , values []string , message any , internalError error ) error
103
103
errors []error
104
104
// failFast is flag for binding methods to return without attempting to bind when previous binding already failed
105
105
failFast bool
@@ -402,17 +402,17 @@ func (b *ValueBinder) MustTextUnmarshaler(sourceParam string, dest encoding.Text
402
402
403
403
// BindWithDelimiter binds parameter to destination by suitable conversion function.
404
404
// Delimiter is used before conversion to split parameter value to separate values
405
- func (b * ValueBinder ) BindWithDelimiter (sourceParam string , dest interface {} , delimiter string ) * ValueBinder {
405
+ func (b * ValueBinder ) BindWithDelimiter (sourceParam string , dest any , delimiter string ) * ValueBinder {
406
406
return b .bindWithDelimiter (sourceParam , dest , delimiter , false )
407
407
}
408
408
409
409
// MustBindWithDelimiter requires parameter value to exist to bind destination by suitable conversion function.
410
410
// Delimiter is used before conversion to split parameter value to separate values
411
- func (b * ValueBinder ) MustBindWithDelimiter (sourceParam string , dest interface {} , delimiter string ) * ValueBinder {
411
+ func (b * ValueBinder ) MustBindWithDelimiter (sourceParam string , dest any , delimiter string ) * ValueBinder {
412
412
return b .bindWithDelimiter (sourceParam , dest , delimiter , true )
413
413
}
414
414
415
- func (b * ValueBinder ) bindWithDelimiter (sourceParam string , dest interface {} , delimiter string , valueMustExist bool ) * ValueBinder {
415
+ func (b * ValueBinder ) bindWithDelimiter (sourceParam string , dest any , delimiter string , valueMustExist bool ) * ValueBinder {
416
416
if b .failFast && b .errors != nil {
417
417
return b
418
418
}
@@ -500,7 +500,7 @@ func (b *ValueBinder) MustInt(sourceParam string, dest *int) *ValueBinder {
500
500
return b .intValue (sourceParam , dest , 0 , true )
501
501
}
502
502
503
- func (b * ValueBinder ) intValue (sourceParam string , dest interface {} , bitSize int , valueMustExist bool ) * ValueBinder {
503
+ func (b * ValueBinder ) intValue (sourceParam string , dest any , bitSize int , valueMustExist bool ) * ValueBinder {
504
504
if b .failFast && b .errors != nil {
505
505
return b
506
506
}
@@ -516,7 +516,7 @@ func (b *ValueBinder) intValue(sourceParam string, dest interface{}, bitSize int
516
516
return b .int (sourceParam , value , dest , bitSize )
517
517
}
518
518
519
- func (b * ValueBinder ) int (sourceParam string , value string , dest interface {} , bitSize int ) * ValueBinder {
519
+ func (b * ValueBinder ) int (sourceParam string , value string , dest any , bitSize int ) * ValueBinder {
520
520
n , err := strconv .ParseInt (value , 10 , bitSize )
521
521
if err != nil {
522
522
if bitSize == 0 {
@@ -542,7 +542,7 @@ func (b *ValueBinder) int(sourceParam string, value string, dest interface{}, bi
542
542
return b
543
543
}
544
544
545
- func (b * ValueBinder ) intsValue (sourceParam string , dest interface {} , valueMustExist bool ) * ValueBinder {
545
+ func (b * ValueBinder ) intsValue (sourceParam string , dest any , valueMustExist bool ) * ValueBinder {
546
546
if b .failFast && b .errors != nil {
547
547
return b
548
548
}
@@ -557,7 +557,7 @@ func (b *ValueBinder) intsValue(sourceParam string, dest interface{}, valueMustE
557
557
return b .ints (sourceParam , values , dest )
558
558
}
559
559
560
- func (b * ValueBinder ) ints (sourceParam string , values []string , dest interface {} ) * ValueBinder {
560
+ func (b * ValueBinder ) ints (sourceParam string , values []string , dest any ) * ValueBinder {
561
561
switch d := dest .(type ) {
562
562
case * []int64 :
563
563
tmp := make ([]int64 , len (values ))
@@ -728,7 +728,7 @@ func (b *ValueBinder) MustUint(sourceParam string, dest *uint) *ValueBinder {
728
728
return b .uintValue (sourceParam , dest , 0 , true )
729
729
}
730
730
731
- func (b * ValueBinder ) uintValue (sourceParam string , dest interface {} , bitSize int , valueMustExist bool ) * ValueBinder {
731
+ func (b * ValueBinder ) uintValue (sourceParam string , dest any , bitSize int , valueMustExist bool ) * ValueBinder {
732
732
if b .failFast && b .errors != nil {
733
733
return b
734
734
}
@@ -744,7 +744,7 @@ func (b *ValueBinder) uintValue(sourceParam string, dest interface{}, bitSize in
744
744
return b .uint (sourceParam , value , dest , bitSize )
745
745
}
746
746
747
- func (b * ValueBinder ) uint (sourceParam string , value string , dest interface {} , bitSize int ) * ValueBinder {
747
+ func (b * ValueBinder ) uint (sourceParam string , value string , dest any , bitSize int ) * ValueBinder {
748
748
n , err := strconv .ParseUint (value , 10 , bitSize )
749
749
if err != nil {
750
750
if bitSize == 0 {
@@ -770,7 +770,7 @@ func (b *ValueBinder) uint(sourceParam string, value string, dest interface{}, b
770
770
return b
771
771
}
772
772
773
- func (b * ValueBinder ) uintsValue (sourceParam string , dest interface {} , valueMustExist bool ) * ValueBinder {
773
+ func (b * ValueBinder ) uintsValue (sourceParam string , dest any , valueMustExist bool ) * ValueBinder {
774
774
if b .failFast && b .errors != nil {
775
775
return b
776
776
}
@@ -785,7 +785,7 @@ func (b *ValueBinder) uintsValue(sourceParam string, dest interface{}, valueMust
785
785
return b .uints (sourceParam , values , dest )
786
786
}
787
787
788
- func (b * ValueBinder ) uints (sourceParam string , values []string , dest interface {} ) * ValueBinder {
788
+ func (b * ValueBinder ) uints (sourceParam string , values []string , dest any ) * ValueBinder {
789
789
switch d := dest .(type ) {
790
790
case * []uint64 :
791
791
tmp := make ([]uint64 , len (values ))
@@ -991,7 +991,7 @@ func (b *ValueBinder) MustFloat32(sourceParam string, dest *float32) *ValueBinde
991
991
return b .floatValue (sourceParam , dest , 32 , true )
992
992
}
993
993
994
- func (b * ValueBinder ) floatValue (sourceParam string , dest interface {} , bitSize int , valueMustExist bool ) * ValueBinder {
994
+ func (b * ValueBinder ) floatValue (sourceParam string , dest any , bitSize int , valueMustExist bool ) * ValueBinder {
995
995
if b .failFast && b .errors != nil {
996
996
return b
997
997
}
@@ -1007,7 +1007,7 @@ func (b *ValueBinder) floatValue(sourceParam string, dest interface{}, bitSize i
1007
1007
return b .float (sourceParam , value , dest , bitSize )
1008
1008
}
1009
1009
1010
- func (b * ValueBinder ) float (sourceParam string , value string , dest interface {} , bitSize int ) * ValueBinder {
1010
+ func (b * ValueBinder ) float (sourceParam string , value string , dest any , bitSize int ) * ValueBinder {
1011
1011
n , err := strconv .ParseFloat (value , bitSize )
1012
1012
if err != nil {
1013
1013
b .setError (b .ErrorFunc (sourceParam , []string {value }, fmt .Sprintf ("failed to bind field value to float%v" , bitSize ), err ))
@@ -1023,7 +1023,7 @@ func (b *ValueBinder) float(sourceParam string, value string, dest interface{},
1023
1023
return b
1024
1024
}
1025
1025
1026
- func (b * ValueBinder ) floatsValue (sourceParam string , dest interface {} , valueMustExist bool ) * ValueBinder {
1026
+ func (b * ValueBinder ) floatsValue (sourceParam string , dest any , valueMustExist bool ) * ValueBinder {
1027
1027
if b .failFast && b .errors != nil {
1028
1028
return b
1029
1029
}
@@ -1038,7 +1038,7 @@ func (b *ValueBinder) floatsValue(sourceParam string, dest interface{}, valueMus
1038
1038
return b .floats (sourceParam , values , dest )
1039
1039
}
1040
1040
1041
- func (b * ValueBinder ) floats (sourceParam string , values []string , dest interface {} ) * ValueBinder {
1041
+ func (b * ValueBinder ) floats (sourceParam string , values []string , dest any ) * ValueBinder {
1042
1042
switch d := dest .(type ) {
1043
1043
case * []float64 :
1044
1044
tmp := make ([]float64 , len (values ))
0 commit comments