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,11 +227,14 @@ func (c *Client) NewRequest(method, path string, opt interface{}) (*http.Request ...@@ -227,11 +227,14 @@ 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
q, err := query.Values(opt) if opt != nil {
if err != nil { q, err := query.Values(opt)
return nil, err if err != nil {
return nil, err
}
u.RawQuery = q.Encode()
} }
u.RawQuery = q.Encode()
req := &http.Request{ req := &http.Request{
Method: method, Method: method,
......
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