Skip to content

Commit

Permalink
typo correction and test gofmt -s apply
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevatkm committed Feb 25, 2020
1 parent bcec4e0 commit da5339d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ func TestClientOptions(t *testing.T) {
assertEqual(t, "default-cookie", client.Cookies[0].Name)

cookies := []*http.Cookie{
&http.Cookie{
{
Name: "default-cookie-1",
Value: "This is default-cookie 1 value",
}, &http.Cookie{
}, {
Name: "default-cookie-2",
Value: "This is default-cookie 2 value",
},
Expand Down
2 changes: 1 addition & 1 deletion middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ func handleRequestBody(c *Client, r *Request) (err error) {
r.bodyBuf = nil

if reader, ok := r.Body.(io.Reader); ok {
if c.setContentLength || r.setContentLength { // keep backward compability
if c.setContentLength || r.setContentLength { // keep backward compatibility
r.bodyBuf = acquireBuffer()
_, err = r.bodyBuf.ReadFrom(reader)
r.Body = nil
Expand Down
10 changes: 5 additions & 5 deletions request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ func TestGetWithCookie(t *testing.T) {
Value: "This is cookie 2 value",
}).
SetCookies([]*http.Cookie{
&http.Cookie{
{
Name: "go-resty-1",
Value: "This is cookie 1 value additional append",
},
Expand All @@ -767,11 +767,11 @@ func TestGetWithCookies(t *testing.T) {
defer ts.Close()

cookies := []*http.Cookie{
&http.Cookie{
{
Name: "go-resty-1",
Value: "This is cookie 1 value",
},
&http.Cookie{
{
Name: "go-resty-2",
Value: "This is cookie 2 value",
},
Expand All @@ -783,11 +783,11 @@ func TestGetWithCookies(t *testing.T) {

tu, _ := url.Parse(ts.URL)
c.GetClient().Jar.SetCookies(tu, []*http.Cookie{
&http.Cookie{
{
Name: "jar-go-resty-1",
Value: "From Jar - This is cookie 1 value",
},
&http.Cookie{
{
Name: "jar-go-resty-2",
Value: "From Jar - This is cookie 2 value",
},
Expand Down
2 changes: 1 addition & 1 deletion resty.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

// Version # of resty
const Version = "2.2.0"
const Version = "2.3.0-dev"

// New method creates a new Resty client.
func New() *Client {
Expand Down
4 changes: 2 additions & 2 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,11 @@ func releaseBuffer(buf *bytes.Buffer) {

func closeq(v interface{}) {
if c, ok := v.(io.Closer); ok {
sliently(c.Close())
silently(c.Close())
}
}

func sliently(_ ...interface{}) {}
func silently(_ ...interface{}) {}

func composeHeaders(c *Client, r *Request, hdrs http.Header) string {
str := make([]string, 0, len(hdrs))
Expand Down

0 comments on commit da5339d

Please sign in to comment.