Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
66f66b30
Commit
66f66b30
authored
Aug 14, 2015
by
Daniel Martí
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some error handling fixes
parent
70b8c323
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
gitlab.go
gitlab.go
+5
-2
No files found.
gitlab.go
View file @
66f66b30
...
...
@@ -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
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment