Skip to content
This repository has been archived by the owner on Oct 2, 2022. It is now read-only.

Commit

Permalink
Rolled back context handling (#5)
Browse files Browse the repository at this point in the history
This release removes the previously erroneously added context handling.
  • Loading branch information
Janos Pasztor authored Dec 15, 2020
1 parent 8a68fe7 commit 19efe54
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.9.4: Rolled back context handling

This release removes the previously erroneously added context handling.

## 0.9.3: Context handling, better errors

This release includes two changes:
Expand Down
2 changes: 0 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package http

import (
"context"
"fmt"
"time"
)
Expand All @@ -14,7 +13,6 @@ type Client interface {
//
// The returned error is always one of ClientError
Post(
ctx context.Context,
path string,
requestBody interface{},
responseBody interface{},
Expand Down
7 changes: 1 addition & 6 deletions client_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package http

import (
"bytes"
"context"
"crypto/tls"
"encoding/json"
"fmt"
Expand All @@ -19,7 +18,6 @@ type client struct {
}

func (c *client) Post(
ctx context.Context,
path string,
requestBody interface{},
responseBody interface{},
Expand All @@ -28,7 +26,6 @@ func (c *client) Post(
error,
) {
return c.request(
ctx,
http.MethodPost,
path,
requestBody,
Expand All @@ -37,7 +34,6 @@ func (c *client) Post(
}

func (c *client) request(
ctx context.Context,
method string,
path string,
requestBody interface{},
Expand All @@ -53,8 +49,7 @@ func (c *client) request(
Message: "failed to encode request body",
}
}
req, err := http.NewRequestWithContext(
ctx,
req, err := http.NewRequest(
method,
fmt.Sprintf("%s%s", c.config.URL, path),
buffer,
Expand Down
1 change: 0 additions & 1 deletion integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ func runRequest(
}()
<-ready
if responseStatus, err = client.Post(
context.Background(),
"",
&Request{Message: message},
&response,
Expand Down

0 comments on commit 19efe54

Please sign in to comment.