Skip to content

Commit

Permalink
fix - agent.Struct fails to unmarshal response since 2.33.0 #2134
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneWerner87 committed Oct 5, 2022
1 parent e85a29a commit 0f3211e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,10 @@ func (a *Agent) Struct(v interface{}) (code int, body []byte, errs []error) {
return
}

if a.jsonDecoder == nil {
a.jsonDecoder = json.Unmarshal
}

if err := a.jsonDecoder(body, v); err != nil {
errs = append(errs, err)
}
Expand Down

1 comment on commit 0f3211e

@ReneWerner87
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 0f3211e Previous: e85a29a Ratio
Benchmark_TrimLeft/fiber 14.1 ns/op 0 B/op 0 allocs/op 3.694 ns/op 0 B/op 0 allocs/op 3.82

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.