We should only call Unlock in the case that we didn't call Authenticate()
before, otherwise we would unlock the mutex twice (which will cause a
runtime error).
---
client.go | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/client.go b/client.go
index 3b541a9..33aa553 100644
--- a/client.go
+++ b/client.go
@@ -112,8 +112,9 @@ func (c *Client) Do(req *Request) (*Response, error) {
if err != nil {
return nil, err
}
+ } else {
+ c.Unlock()
}
- c.Unlock()
// Check the required capabilities before making the request
for _, uri := range req.Using {
c.Lock()
--
2.47.1