Skip to content

Commit af2fa35

Browse files
committed
Improved code with Lint suggestion and readme update
1 parent e1a871f commit af2fa35

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# resty [![Build Status](https://travis-ci.org/go-resty/resty.svg?branch=master)](https://travis-ci.org/go-resty/resty) [![GoCover](http://gocover.io/_badge/github.com/go-resty/resty)](http://gocover.io/github.com/go-resty/resty) [![GoDoc](https://godoc.org/github.com/go-resty/resty?status.svg)](https://godoc.org/github.com/go-resty/resty) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
22

3-
Simple HTTP and REST client for Go inspired by Ruby rest-client.
3+
Simple HTTP and REST client for Go inspired by Ruby rest-client. Provides notable features - robust request body input, auto marshal & unmarshal, request and response middlewares, custom & extensible redirect policy (multiple policies can be applied), etc.
44

55
#### Features
66
* Get, Post, Put, Delete, Head, Patch and Options
@@ -33,7 +33,11 @@ Simple HTTP and REST client for Go inspired by Ruby rest-client.
3333
resty tested with Go 1.2 and above.
3434

3535
#### Included Batteries
36-
* Redirect Policies - NoRedirectPolicy, FlexibleRedirectPolicy, DomainCheckRedirectPolicy, etc. [more info](redirect.go)
36+
* Redirect Policies
37+
* NoRedirectPolicy
38+
* FlexibleRedirectPolicy
39+
* DomainCheckRedirectPolicy
40+
* etc. [more info](redirect.go)
3741
* Write Cookies to file from CookiesJar (upcoming)
3842
* etc.
3943

client.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,11 @@ func (c *Client) SetTimeout(timeout time.Duration) *Client {
475475
// Alternative: Without this `SetProxy` method, you can also set Proxy via environment variable.
476476
// By default `Go` uses setting from `HTTP_PROXY`.
477477
//
478-
func (c *Client) SetProxy(proxyUrl string) *Client {
479-
if pURL, err := url.Parse(proxyUrl); err == nil {
478+
func (c *Client) SetProxy(proxyURL string) *Client {
479+
if pURL, err := url.Parse(proxyURL); err == nil {
480480
c.transport.Proxy = http.ProxyURL(pURL)
481481
} else {
482-
c.Log.Printf("ERROR: %s", err)
482+
c.Log.Printf("ERROR: %v", err)
483483
}
484484

485485
return c

default.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ func SetTimeout(timeout time.Duration) *Client {
183183
}
184184

185185
// SetProxy method sets Proxy for request. See Client.SetProxy for more information.
186-
func SetProxy(proxyUrl string) *Client {
187-
return DefaultClient.SetProxy(proxyUrl)
186+
func SetProxy(proxyURL string) *Client {
187+
return DefaultClient.SetProxy(proxyURL)
188188
}
189189

190190
// RemoveProxy method removes the proxy configuration. See Client.RemoveProxy for more information.

redirect.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import (
1212
"strings"
1313
)
1414

15+
// RedirectPolicy to regulate the redirects in the resty client.
1516
// Objects implementing the RedirectPolicy interface can be registered as
16-
// RedirectPolicy to regulate the redirects in the resty.
1717
//
1818
// Apply function should return nil to continue the redirect jounery, otherwise
1919
// return error to stop the redirect.

resty.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ Package resty provides simple HTTP and REST client for Go inspired by Ruby rest-
99
package resty
1010

1111
// go-resty version no
12-
var Version = "0.1"
12+
var Version = "0.2.1"

0 commit comments

Comments
 (0)