@@ -83,12 +83,12 @@ func BindStyledParameterWithOptions(style string, paramName string, value string
8383 // since prior to this refactoring, they always query unescaped.
8484 value , err = url .QueryUnescape (value )
8585 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 )
8787 }
8888 case ParamLocationPath :
8989 value , err = url .PathUnescape (value )
9090 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 )
9292 }
9393 default :
9494 // Headers and cookies aren't escaped.
@@ -97,7 +97,7 @@ func BindStyledParameterWithOptions(style string, paramName string, value string
9797 // If the destination implements encoding.TextUnmarshaler we use it for binding
9898 if tu , ok := dest .(encoding.TextUnmarshaler ); ok {
9999 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 )
101101 }
102102
103103 return nil
@@ -124,7 +124,7 @@ func BindStyledParameterWithOptions(style string, paramName string, value string
124124 // Chop up the parameter into parts based on its style
125125 parts , err := splitStyledParameter (style , opts .Explode , false , paramName , value )
126126 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 )
128128 }
129129
130130 return bindSplitPartsToDestinationArray (parts , dest )
@@ -287,7 +287,7 @@ func bindSplitPartsToDestinationStruct(paramName string, parts []string, explode
287287 jsonParam := "{" + strings .Join (fields , "," ) + "}"
288288 err := json .Unmarshal ([]byte (jsonParam ), dest )
289289 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 )
291291 }
292292 return nil
293293}
0 commit comments