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
cf47d4b1
Commit
cf47d4b1
authored
Nov 24, 2015
by
Martin Sefcik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverted back Go 1.5 related code
parent
8ab3d8fc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
13 deletions
+12
-13
.travis.yml
.travis.yml
+1
-1
README.md
README.md
+1
-3
gitlab.go
gitlab.go
+8
-7
gitlab_test.go
gitlab_test.go
+2
-2
No files found.
.travis.yml
View file @
cf47d4b1
language
:
go
go
:
-
1.
5
-
1.
4
README.md
View file @
cf47d4b1
...
...
@@ -3,9 +3,7 @@
A GitLab API client enabling Go programs to interact with GitLab in a simple and uniform way
**Documentation:**
[
![GoDoc
](
https://godoc.org/github.com/xanzy/go-gitlab?status.svg
)
](https://godoc.org/github.com/xanzy/go-gitlab)
**Build Status:**
[
![Build Status
](
https://travis-ci.org/xanzy/go-gitlab.svg?branch=master
)
](https://travis-ci.org/xanzy/go-gitlab)
go-gitlab requires Go version 1.5 or greater.
**Build Status:**
[
![Build Status
](
https://travis-ci.org/xanzy/go-gitlab.svg?branch=master
)
](https://travis-ci.org/xanzy/go-gitlab)
## Coverage
...
...
gitlab.go
View file @
cf47d4b1
...
...
@@ -196,10 +196,9 @@ func (c *Client) SetBaseURL(urlStr string) error {
// specified, the value pointed to by body is JSON encoded and included as the
// request body.
func
(
c
*
Client
)
NewRequest
(
method
,
path
string
,
opt
interface
{})
(
*
http
.
Request
,
error
)
{
u
,
err
:=
url
.
Parse
(
c
.
baseURL
.
String
()
+
path
)
if
err
!=
nil
{
return
nil
,
err
}
u
:=
*
c
.
baseURL
// Set the encoded opaque data
u
.
Opaque
=
c
.
baseURL
.
Path
+
path
q
,
err
:=
query
.
Values
(
opt
)
if
err
!=
nil
{
...
...
@@ -209,7 +208,7 @@ func (c *Client) NewRequest(method, path string, opt interface{}) (*http.Request
req
:=
&
http
.
Request
{
Method
:
method
,
URL
:
u
,
URL
:
&
u
,
Proto
:
"HTTP/1.1"
,
ProtoMajor
:
1
,
ProtoMinor
:
1
,
...
...
@@ -350,9 +349,11 @@ type ErrorResponse struct {
}
func
(
r
*
ErrorResponse
)
Error
()
string
{
path
,
_
:=
url
.
QueryUnescape
(
r
.
Response
.
Request
.
URL
.
Opaque
)
ru
:=
fmt
.
Sprintf
(
"%s://%s%s"
,
r
.
Response
.
Request
.
URL
.
Scheme
,
r
.
Response
.
Request
.
URL
.
Host
,
path
)
return
fmt
.
Sprintf
(
"%v %s: %d %v %+v"
,
r
.
Response
.
Request
.
Method
,
r
.
Response
.
Request
.
URL
.
String
(),
r
.
Response
.
StatusCode
,
r
.
Message
,
r
.
Errors
)
r
.
Response
.
Request
.
Method
,
ru
,
r
.
Response
.
StatusCode
,
r
.
Message
,
r
.
Errors
)
}
// An Error reports more details on an individual error in an ErrorResponse.
...
...
gitlab_test.go
View file @
cf47d4b1
...
...
@@ -33,8 +33,8 @@ func teardown(server *httptest.Server) {
}
func
testUrl
(
t
*
testing
.
T
,
r
*
http
.
Request
,
want
string
)
{
if
got
:=
r
.
URL
.
String
()
;
got
!=
want
{
t
.
Errorf
(
"Request url: %
s
, want %s"
,
got
,
want
)
if
got
:=
r
.
RequestURI
;
got
!=
want
{
t
.
Errorf
(
"Request url: %
+v
, want %s"
,
got
,
want
)
}
}
...
...
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