Skip to content

Commit 3753eb0

Browse files
authored
Merge pull request #89 from trickest/fix/url-formatting
Check for arguments before applying URL formatting
2 parents bca54c0 + f1ea293 commit 3753eb0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

client/request/request.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ func (r *Request) Verb(verb string) *Request {
9999
}
100100

101101
func (r *Request) DoF(url string, v ...interface{}) *Response {
102-
return r.Do(fmt.Sprintf(url, v...))
102+
if len(v) > 0 {
103+
url = fmt.Sprintf(url, v...)
104+
}
105+
return r.Do(url)
103106
}
104107

105108
func (r *Request) Do(url string) *Response {

0 commit comments

Comments
 (0)