aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'client.go')
-rw-r--r--client.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/client.go b/client.go
index 50ed236..f8c5aab 100644
--- a/client.go
+++ b/client.go
@@ -43,11 +43,7 @@ func NewClient(directory string) (*Client, error) {
}
defer resp.Body.Close()
defer c.replyNonce(resp)
- err = json.NewDecoder(resp.Body).Decode(&c.Directory)
- if err != nil {
- return nil, err
- }
- return c, nil
+ return c, json.NewDecoder(resp.Body).Decode(&c.Directory)
}
var errNoNonces = errors.New("out of nonces")
@@ -88,7 +84,8 @@ func (c *Client) post(uri string, s Signer, v interface{}) (*http.Response, erro
}
log.Println(ansi.Color("POST", "red+b"), uri, string(body))
- signed, err := s.Sign(body, c)
+ s.Init(c)
+ signed, err := s.Sign(body)
if err != nil {
return nil, err
}