From 2a3ee9ca418c6a8664a493b1c1a67fec6acba9f5 Mon Sep 17 00:00:00 2001 From: RW Date: Wed, 5 Oct 2022 09:04:29 +0200 Subject: [PATCH] fix - agent.Struct fails to unmarshal response since 2.33.0 #2134 (#2137) --- client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client.go b/client.go index deedc0f5..4a520b78 100644 --- a/client.go +++ b/client.go @@ -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) }