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
2b019087
Unverified
Commit
2b019087
authored
Mar 04, 2019
by
Sander van Harmelen
Committed by
GitHub
Mar 04, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #574 from xanzy/svh/f-go-mod
Update go.mod and run go fmt
parents
7b753590
817cb792
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
17 deletions
+25
-17
go.mod
go.mod
+1
-0
go.sum
go.sum
+7
-0
group_badges.go
group_badges.go
+7
-7
groups_badges_test.go
groups_badges_test.go
+2
-2
projects_test.go
projects_test.go
+8
-8
No files found.
go.mod
View file @
2b019087
...
...
@@ -2,6 +2,7 @@ module github.com/xanzy/go-gitlab
require (
github.com/google/go-querystring v1.0.0
github.com/stretchr/testify v1.3.0
golang.org/x/net v0.0.0-20181108082009-03003ca0c849 // indirect
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f // indirect
...
...
go.sum
View file @
2b019087
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181108082009-03003ca0c849 h1:FSqE2GGG7wzsYUsWiQ8MZrvEd1EOyU3NCF0AW3Wtltg=
golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
...
...
group_badges.go
View file @
2b019087
...
...
@@ -19,7 +19,7 @@ type BadgeKind string
// all possible values Badge Kind
const
(
ProjectBadgeKind
BadgeKind
=
"project"
GroupBadgeKind
BadgeKind
=
"group"
GroupBadgeKind
BadgeKind
=
"group"
)
// GroupBadge represents a group badge.
...
...
@@ -27,12 +27,12 @@ const (
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_badges.html
type
GroupBadge
struct
{
ID
int
`json:"id"`
LinkURL
string
`json:"link_url"`
ImageURL
string
`json:"image_url"`
RenderedLinkURL
string
`json:"rendered_link_url"`
RenderedImageURL
string
`json:"rendered_image_url"`
Kind
BadgeKind
`json:"kind"`
ID
int
`json:"id"`
LinkURL
string
`json:"link_url"`
ImageURL
string
`json:"image_url"`
RenderedLinkURL
string
`json:"rendered_link_url"`
RenderedImageURL
string
`json:"rendered_image_url"`
Kind
BadgeKind
`json:"kind"`
}
// ListGroupBadgesOptions represents the available ListGroupBadges() options.
...
...
groups_badges_test.go
View file @
2b019087
...
...
@@ -59,7 +59,7 @@ func TestAddGroupBadge(t *testing.T) {
fmt
.
Fprint
(
w
,
`{"id":3, "link_url":"LINK", "image_url":"IMAGE", "kind":"group"}`
)
})
opt
:=
&
AddGroupBadgeOptions
{
ImageURL
:
String
(
"IMAGE"
),
LinkURL
:
String
(
"LINK"
)
,
}
opt
:=
&
AddGroupBadgeOptions
{
ImageURL
:
String
(
"IMAGE"
),
LinkURL
:
String
(
"LINK"
)}
badge
,
_
,
err
:=
client
.
GroupBadges
.
AddGroupBadge
(
1
,
opt
)
if
err
!=
nil
{
t
.
Errorf
(
"GroupBadges.AddGroupBadge returned error: %v"
,
err
)
...
...
@@ -81,7 +81,7 @@ func TestEditGroupBadge(t *testing.T) {
fmt
.
Fprint
(
w
,
`{"id":2, "link_url":"NEW_LINK", "image_url":"NEW_IMAGE", "kind":"group"}`
)
})
opt
:=
&
EditGroupBadgeOptions
{
ImageURL
:
String
(
"NEW_IMAGE"
),
LinkURL
:
String
(
"NEW_LINK"
)
,
}
opt
:=
&
EditGroupBadgeOptions
{
ImageURL
:
String
(
"NEW_IMAGE"
),
LinkURL
:
String
(
"NEW_LINK"
)}
badge
,
_
,
err
:=
client
.
GroupBadges
.
EditGroupBadge
(
1
,
2
,
opt
)
if
err
!=
nil
{
t
.
Errorf
(
"GroupBadges.EditGroupBadge returned error: %v"
,
err
)
...
...
projects_test.go
View file @
2b019087
...
...
@@ -409,10 +409,10 @@ func TestGetApprovalConfiguration(t *testing.T) {
}
want
:=
&
ProjectApprovals
{
Approvers
:
[]
*
MergeRequestApproverUser
{},
ApproverGroups
:
[]
*
MergeRequestApproverGroup
{},
ApprovalsBeforeMerge
:
3
,
ResetApprovalsOnPush
:
false
,
Approvers
:
[]
*
MergeRequestApproverUser
{},
ApproverGroups
:
[]
*
MergeRequestApproverGroup
{},
ApprovalsBeforeMerge
:
3
,
ResetApprovalsOnPush
:
false
,
DisableOverridingApproversPerMergeRequest
:
false
,
}
...
...
@@ -447,10 +447,10 @@ func TestChangeApprovalConfiguration(t *testing.T) {
}
want
:=
&
ProjectApprovals
{
Approvers
:
[]
*
MergeRequestApproverUser
{},
ApproverGroups
:
[]
*
MergeRequestApproverGroup
{},
ApprovalsBeforeMerge
:
3
,
ResetApprovalsOnPush
:
false
,
Approvers
:
[]
*
MergeRequestApproverUser
{},
ApproverGroups
:
[]
*
MergeRequestApproverGroup
{},
ApprovalsBeforeMerge
:
3
,
ResetApprovalsOnPush
:
false
,
DisableOverridingApproversPerMergeRequest
:
false
,
}
...
...
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