Commit 32d53f1b authored by Sander van Harmelen's avatar Sander van Harmelen

Merge pull request #6 from mvdan/patches

Some fixes
parents 70b8c323 4016c5be
......@@ -123,7 +123,10 @@ func NewClient(httpClient *http.Client, token string) *Client {
}
c := &Client{client: httpClient, token: token, UserAgent: userAgent}
c.SetBaseURL(defaultBaseURL)
if err := c.SetBaseURL(defaultBaseURL); err != nil {
// should never happen since defaultBaseURL is our constant
panic(err)
}
c.Branches = &BranchesService{client: c}
c.Commits = &CommitsService{client: c}
......@@ -300,7 +303,7 @@ func (c *Client) Do(req *http.Request, v interface{}) (*Response, error) {
if v != nil {
if w, ok := v.(io.Writer); ok {
io.Copy(w, resp.Body)
_, err = io.Copy(w, resp.Body)
} else {
err = json.NewDecoder(resp.Body).Decode(v)
}
......
......@@ -52,17 +52,17 @@ type Project struct {
MergeRequestsEnabled bool `json:"merge_requests_enabled"`
WikiEnabled bool `json:"wiki_enabled"`
SnippetsEnabled bool `json:"snippets_enabled"`
CreatedAt string `json:"created_at"`
LastActivityAt string `json:"last_activity_at"`
CreatedAt time.Time `json:"created_at"`
LastActivityAt time.Time `json:"last_activity_at"`
CreatorID int `json:"creator_id"`
Namespace struct {
CreatedAt string `json:"created_at"`
Description string `json:"description"`
ID int `json:"id"`
Name string `json:"name"`
OwnerID int `json:"owner_id"`
Path string `json:"path"`
UpdatedAt string `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
Description string `json:"description"`
ID int `json:"id"`
Name string `json:"name"`
OwnerID int `json:"owner_id"`
Path string `json:"path"`
UpdatedAt time.Time `json:"updated_at"`
} `json:"namespace"`
Archived bool `json:"archived"`
AvatarURL string `json:"avatar_url"`
......
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