@@ -83,12 +83,12 @@ func BindStyledParameterWithOptions(style string, paramName string, value string
83
83
// since prior to this refactoring, they always query unescaped.
84
84
value , err = url .QueryUnescape (value )
85
85
if err != nil {
86
- return fmt .Errorf ("error unescaping query parameter '%s': %v " , paramName , err )
86
+ return fmt .Errorf ("error unescaping query parameter '%s': %w " , paramName , err )
87
87
}
88
88
case ParamLocationPath :
89
89
value , err = url .PathUnescape (value )
90
90
if err != nil {
91
- return fmt .Errorf ("error unescaping path parameter '%s': %v " , paramName , err )
91
+ return fmt .Errorf ("error unescaping path parameter '%s': %w " , paramName , err )
92
92
}
93
93
default :
94
94
// Headers and cookies aren't escaped.
@@ -97,7 +97,7 @@ func BindStyledParameterWithOptions(style string, paramName string, value string
97
97
// If the destination implements encoding.TextUnmarshaler we use it for binding
98
98
if tu , ok := dest .(encoding.TextUnmarshaler ); ok {
99
99
if err := tu .UnmarshalText ([]byte (value )); err != nil {
100
- return fmt .Errorf ("error unmarshaling '%s' text as %T: %s " , value , dest , err )
100
+ return fmt .Errorf ("error unmarshaling '%s' text as %T: %w " , value , dest , err )
101
101
}
102
102
103
103
return nil
@@ -124,7 +124,7 @@ func BindStyledParameterWithOptions(style string, paramName string, value string
124
124
// Chop up the parameter into parts based on its style
125
125
parts , err := splitStyledParameter (style , opts .Explode , false , paramName , value )
126
126
if err != nil {
127
- return fmt .Errorf ("error splitting input '%s' into parts: %s " , value , err )
127
+ return fmt .Errorf ("error splitting input '%s' into parts: %w " , value , err )
128
128
}
129
129
130
130
return bindSplitPartsToDestinationArray (parts , dest )
@@ -287,7 +287,7 @@ func bindSplitPartsToDestinationStruct(paramName string, parts []string, explode
287
287
jsonParam := "{" + strings .Join (fields , "," ) + "}"
288
288
err := json .Unmarshal ([]byte (jsonParam ), dest )
289
289
if err != nil {
290
- return fmt .Errorf ("error binding parameter %s fields: %s " , paramName , err )
290
+ return fmt .Errorf ("error binding parameter %s fields: %w " , paramName , err )
291
291
}
292
292
return nil
293
293
}
0 commit comments