We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c9becdc commit 74ad0f8Copy full SHA for 74ad0f8
1 file changed
internal/requestconfig/requestconfig.go
@@ -540,15 +540,15 @@ func (cfg *RequestConfig) Execute() (err error) {
540
return nil
541
}
542
543
- // If the response happens to be a byte array, deserialize the body as-is.
544
switch dst := cfg.ResponseBodyInto.(type) {
+ // If the response happens to be a byte array, deserialize the body as-is.
545
case *[]byte:
546
*dst = contents
547
- }
548
-
549
- err = json.NewDecoder(bytes.NewReader(contents)).Decode(cfg.ResponseBodyInto)
550
- if err != nil {
551
- return fmt.Errorf("error parsing response json: %w", err)
+ default:
+ err = json.NewDecoder(bytes.NewReader(contents)).Decode(cfg.ResponseBodyInto)
+ if err != nil {
+ return fmt.Errorf("error parsing response json: %w", err)
+ }
552
553
554
0 commit comments