Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions gogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (c *Client) SetHTTPClient(client *http.Client) {
c.client = client
}

func (c *Client) getResponse(method, path string, header http.Header, body io.Reader) ([]byte, error) {
func (c *Client) doRequest(method, path string, header http.Header, body io.Reader) (*http.Response, error) {
req, err := http.NewRequest(method, c.url+"/api/v1"+path, body)
if err != nil {
return nil, err
Expand All @@ -48,7 +48,11 @@ func (c *Client) getResponse(method, path string, header http.Header, body io.Re
req.Header[k] = v
}

resp, err := c.client.Do(req)
return c.client.Do(req)
}

func (c *Client) getResponse(method, path string, header http.Header, body io.Reader) ([]byte, error) {
resp, err := c.doRequest(method, path, header, body)
if err != nil {
return nil, err
}
Expand Down