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
43268025
Commit
43268025
authored
Nov 27, 2015
by
Daniel Martí
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused code
parent
da1b3706
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
33 deletions
+0
-33
gitlab.go
gitlab.go
+0
-33
No files found.
gitlab.go
View file @
43268025
...
@@ -398,39 +398,6 @@ func CheckResponse(r *http.Response) error {
...
@@ -398,39 +398,6 @@ func CheckResponse(r *http.Response) error {
return
errorResponse
return
errorResponse
}
}
// parseBoolResponse determines the boolean result from a GitLab API response.
// Several GitLab API methods return boolean responses indicated by the HTTP
// status code in the response (true indicated by a 204, false indicated by a
// 404). This helper function will determine that result and hide the 404 error
// if present. Any other error will be returned through as-is.
func
parseBoolResponse
(
err
error
)
(
bool
,
error
)
{
if
err
==
nil
{
return
true
,
nil
}
if
err
,
ok
:=
err
.
(
*
ErrorResponse
);
ok
&&
err
.
Response
.
StatusCode
==
http
.
StatusNotFound
{
// Simply false. In this one case, we do not pass the error through.
return
false
,
nil
}
// some other real error occurred
return
false
,
err
}
// cloneRequest returns a clone of the provided *http.Request. The clone is a
// shallow copy of the struct and its Header map.
func
cloneRequest
(
r
*
http
.
Request
)
*
http
.
Request
{
// shallow copy of the struct
r2
:=
new
(
http
.
Request
)
*
r2
=
*
r
// deep copy of the Header
r2
.
Header
=
make
(
http
.
Header
)
for
k
,
s
:=
range
r
.
Header
{
r2
.
Header
[
k
]
=
s
}
return
r2
}
// Bool is a helper routine that allocates a new bool value
// Bool is a helper routine that allocates a new bool value
// to store v and returns a pointer to it.
// to store v and returns a pointer to it.
func
Bool
(
v
bool
)
*
bool
{
func
Bool
(
v
bool
)
*
bool
{
...
...
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