Commit d7e810c7 authored by wolfitem's avatar wolfitem Committed by Sander van Harmelen

Update gitlab.go (#75)

Add ops is equal to null judgment
parent e3e5e785
...@@ -227,12 +227,15 @@ func (c *Client) NewRequest(method, path string, opt interface{}) (*http.Request ...@@ -227,12 +227,15 @@ func (c *Client) NewRequest(method, path string, opt interface{}) (*http.Request
// Set the encoded opaque data // Set the encoded opaque data
u.Opaque = c.baseURL.Path + path u.Opaque = c.baseURL.Path + path
if opt != nil {
q, err := query.Values(opt) q, err := query.Values(opt)
if err != nil { if err != nil {
return nil, err return nil, err
} }
u.RawQuery = q.Encode() u.RawQuery = q.Encode()
}
req := &http.Request{ req := &http.Request{
Method: method, Method: method,
URL: &u, URL: &u,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment