Skip to content

Commit 9e38892

Browse files
committed
Formatted the project using gofumpt
1 parent f46a273 commit 9e38892

32 files changed

+107
-127
lines changed

broadcast_messages_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ func TestListBroadcastMessages(t *testing.T) {
6161
t.Errorf("ListBroadcastMessages returned error: %v", err)
6262
}
6363

64-
wantedFirstStartsAt := time.Date(2017, 06, 26, 6, 0, 0, 0, time.UTC)
65-
wantedFirstEndsAt := time.Date(2017, 06, 27, 12, 59, 0, 0, time.UTC)
64+
wantedFirstStartsAt := time.Date(2017, 0o6, 26, 6, 0, 0, 0, time.UTC)
65+
wantedFirstEndsAt := time.Date(2017, 0o6, 27, 12, 59, 0, 0, time.UTC)
6666

67-
wantedSecondStartsAt := time.Date(2015, 04, 27, 6, 43, 0, 0, time.UTC)
68-
wantedSecondEndsAt := time.Date(2015, 04, 28, 20, 43, 0, 0, time.UTC)
67+
wantedSecondStartsAt := time.Date(2015, 0o4, 27, 6, 43, 0, 0, time.UTC)
68+
wantedSecondEndsAt := time.Date(2015, 0o4, 28, 20, 43, 0, 0, time.UTC)
6969

7070
want := []*BroadcastMessage{{
7171
Message: "Some Message",

commits_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestGetCommit(t *testing.T) {
4545
t.Fatalf("Commits.GetCommit returned error: %v, response: %v", err, resp)
4646
}
4747

48-
updatedAt := time.Date(2019, 11, 4, 15, 39, 03, 935000000, time.UTC)
48+
updatedAt := time.Date(2019, 11, 4, 15, 39, 0o3, 935000000, time.UTC)
4949
createdAt := time.Date(2019, 11, 4, 15, 38, 53, 154000000, time.UTC)
5050
want := &Commit{
5151
ID: "6104942438c14ec7bd21c6cd5bd995272b3faff6",
@@ -89,7 +89,6 @@ func TestGetCommitStatuses(t *testing.T) {
8989
All: Bool(true),
9090
}
9191
statuses, _, err := client.Commits.GetCommitStatuses("1", "b0b3a907f41409829b307a28b82fdbd552ee5a27", opt)
92-
9392
if err != nil {
9493
t.Errorf("Commits.GetCommitStatuses returned error: %v", err)
9594
}
@@ -128,7 +127,6 @@ func TestSetCommitStatus(t *testing.T) {
128127
Coverage: &cov,
129128
}
130129
status, _, err := client.Commits.SetCommitStatus("1", "b0b3a907f41409829b307a28b82fdbd552ee5a27", opt)
131-
132130
if err != nil {
133131
t.Errorf("Commits.SetCommitStatus returned error: %v", err)
134132
}
@@ -152,7 +150,7 @@ func TestRevertCommit_NoOptions(t *testing.T) {
152150
t.Fatalf("Commits.RevertCommit returned error: %v, response: %v", err, resp)
153151
}
154152

155-
updatedAt := time.Date(2019, 11, 4, 15, 39, 03, 935000000, time.UTC)
153+
updatedAt := time.Date(2019, 11, 4, 15, 39, 0o3, 935000000, time.UTC)
156154
createdAt := time.Date(2019, 11, 4, 15, 38, 53, 154000000, time.UTC)
157155
want := &Commit{
158156
ID: "6104942438c14ec7bd21c6cd5bd995272b3faff6",
@@ -197,7 +195,7 @@ func TestRevertCommit_WithOptions(t *testing.T) {
197195
t.Fatalf("Commits.RevertCommit returned error: %v, response: %v", err, resp)
198196
}
199197

200-
updatedAt := time.Date(2019, 11, 4, 15, 39, 03, 935000000, time.UTC)
198+
updatedAt := time.Date(2019, 11, 4, 15, 39, 0o3, 935000000, time.UTC)
201199
createdAt := time.Date(2019, 11, 4, 15, 38, 53, 154000000, time.UTC)
202200
want := &Commit{
203201
ID: "6104942438c14ec7bd21c6cd5bd995272b3faff6",
@@ -291,7 +289,7 @@ func TestCommitsService_ListCommits(t *testing.T) {
291289
`)
292290
})
293291

294-
updatedAt := time.Date(2019, 11, 4, 15, 39, 03, 935000000, time.UTC)
292+
updatedAt := time.Date(2019, 11, 4, 15, 39, 0o3, 935000000, time.UTC)
295293
createdAt := time.Date(2019, 11, 4, 15, 38, 53, 154000000, time.UTC)
296294
want := []*Commit{{
297295
ID: "6104942438c14ec7bd21c6cd5bd995272b3faff6",
@@ -431,7 +429,7 @@ func TestCommitsService_CreateCommit(t *testing.T) {
431429
`)
432430
})
433431

434-
updatedAt := time.Date(2019, 11, 4, 15, 39, 03, 935000000, time.UTC)
432+
updatedAt := time.Date(2019, 11, 4, 15, 39, 0o3, 935000000, time.UTC)
435433
createdAt := time.Date(2019, 11, 4, 15, 38, 53, 154000000, time.UTC)
436434
want := &Commit{
437435
ID: "6104942438c14ec7bd21c6cd5bd995272b3faff6",
@@ -782,7 +780,8 @@ func TestCommitsService_ListMergeRequestsByCommit(t *testing.T) {
782780
Title: "v2.0",
783781
Description: "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
784782
State: "closed",
785-
WebURL: "https://gitlab.example.com/my-group/my-project/milestones/1"},
783+
WebURL: "https://gitlab.example.com/my-group/my-project/milestones/1",
784+
},
786785
MergeWhenPipelineSucceeds: true,
787786
DetailedMergeStatus: "mergeable",
788787
MergeError: "",
@@ -792,7 +791,8 @@ func TestCommitsService_ListMergeRequestsByCommit(t *testing.T) {
792791
Name: "Douwe Maan",
793792
State: "active",
794793
AvatarURL: "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
795-
WebURL: "https://gitlab.com/DouweM"},
794+
WebURL: "https://gitlab.com/DouweM",
795+
},
796796
Subscribed: false,
797797
SHA: "8888888888888888888888888888888888888888",
798798
MergeCommitSHA: "",
@@ -883,7 +883,7 @@ func TestCommitsService_CherryPickCommit(t *testing.T) {
883883
`)
884884
})
885885

886-
updatedAt := time.Date(2019, 11, 4, 15, 39, 03, 935000000, time.UTC)
886+
updatedAt := time.Date(2019, 11, 4, 15, 39, 0o3, 935000000, time.UTC)
887887
createdAt := time.Date(2019, 11, 4, 15, 38, 53, 154000000, time.UTC)
888888
want := &Commit{
889889
ID: "6104942438c14ec7bd21c6cd5bd995272b3faff6",

container_registry_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ func TestDeleteRegistryRepositoryTags(t *testing.T) {
339339
testMethod(t, r, http.MethodDelete)
340340
})
341341

342-
var tests = []struct {
342+
tests := []struct {
343343
event string
344344
nameRegexDelete string
345345
keepN int

custom_attributes_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ func TestListCustomUserAttributes(t *testing.T) {
3232
})
3333

3434
customAttributes, _, err := client.CustomAttribute.ListCustomUserAttributes(2)
35-
3635
if err != nil {
3736
t.Errorf("CustomAttribute.ListCustomUserAttributes returned error: %v", err)
3837
}
@@ -52,7 +51,6 @@ func TestListCustomGroupAttributes(t *testing.T) {
5251
})
5352

5453
customAttributes, _, err := client.CustomAttribute.ListCustomGroupAttributes(2)
55-
5654
if err != nil {
5755
t.Errorf("CustomAttribute.ListCustomGroupAttributes returned error: %v", err)
5856
}
@@ -72,7 +70,6 @@ func TestListCustomProjectAttributes(t *testing.T) {
7270
})
7371

7472
customAttributes, _, err := client.CustomAttribute.ListCustomProjectAttributes(2)
75-
7673
if err != nil {
7774
t.Errorf("CustomAttribute.ListCustomProjectAttributes returned error: %v", err)
7875
}
@@ -92,7 +89,6 @@ func TestGetCustomUserAttribute(t *testing.T) {
9289
})
9390

9491
customAttribute, _, err := client.CustomAttribute.GetCustomUserAttribute(2, "testkey1")
95-
9692
if err != nil {
9793
t.Errorf("CustomAttribute.GetCustomUserAttribute returned error: %v", err)
9894
}
@@ -112,7 +108,6 @@ func TestGetCustomGropupAttribute(t *testing.T) {
112108
})
113109

114110
customAttribute, _, err := client.CustomAttribute.GetCustomGroupAttribute(2, "testkey1")
115-
116111
if err != nil {
117112
t.Errorf("CustomAttribute.GetCustomGroupAttribute returned error: %v", err)
118113
}
@@ -132,7 +127,6 @@ func TestGetCustomProjectAttribute(t *testing.T) {
132127
})
133128

134129
customAttribute, _, err := client.CustomAttribute.GetCustomProjectAttribute(2, "testkey1")
135-
136130
if err != nil {
137131
t.Errorf("CustomAttribute.GetCustomProjectAttribute returned error: %v", err)
138132
}
@@ -155,7 +149,6 @@ func TestSetCustomUserAttribute(t *testing.T) {
155149
Key: "testkey1",
156150
Value: "testvalue1",
157151
})
158-
159152
if err != nil {
160153
t.Errorf("CustomAttribute.SetCustomUserAttributes returned error: %v", err)
161154
}
@@ -178,7 +171,6 @@ func TestSetCustomGroupAttribute(t *testing.T) {
178171
Key: "testkey1",
179172
Value: "testvalue1",
180173
})
181-
182174
if err != nil {
183175
t.Errorf("CustomAttribute.SetCustomGroupAttributes returned error: %v", err)
184176
}

deploy_tokens_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func TestListAllDeployTokens(t *testing.T) {
5050
t.Errorf("DeployTokens.ListAllDeployTokens returned an error: %v", err)
5151
}
5252

53-
wantExpiresAt := time.Date(2020, 02, 14, 0, 0, 0, 0, time.UTC)
53+
wantExpiresAt := time.Date(2020, 0o2, 14, 0, 0, 0, 0, time.UTC)
5454

5555
want := []*DeployToken{
5656
{
@@ -96,7 +96,7 @@ func TestListProjectDeployTokens(t *testing.T) {
9696
t.Errorf("DeployTokens.ListProjectDeployTokens returned an error: %v", err)
9797
}
9898

99-
wantExpiresAt := time.Date(2020, 02, 14, 0, 0, 0, 0, time.UTC)
99+
wantExpiresAt := time.Date(2020, 0o2, 14, 0, 0, 0, 0, time.UTC)
100100

101101
want := []*DeployToken{
102102
{
@@ -140,7 +140,7 @@ func TestGetProjectDeployTokens(t *testing.T) {
140140
t.Errorf("DeployTokens.GetProjectDeployToken returned an error: %v", err)
141141
}
142142

143-
wantExpiresAt := time.Date(2020, 02, 14, 0, 0, 0, 0, time.UTC)
143+
wantExpiresAt := time.Date(2020, 0o2, 14, 0, 0, 0, 0, time.UTC)
144144

145145
want := &DeployToken{
146146
ID: 1,
@@ -177,7 +177,7 @@ func TestCreateProjectDeployToken(t *testing.T) {
177177
`)
178178
})
179179

180-
expiresAt := time.Date(2021, 01, 01, 0, 0, 0, 0, time.UTC)
180+
expiresAt := time.Date(2021, 0o1, 0o1, 0, 0, 0, 0, time.UTC)
181181

182182
deployToken, _, err := client.DeployTokens.CreateProjectDeployToken(5, &CreateProjectDeployTokenOptions{
183183
Name: String("My deploy token"),
@@ -254,7 +254,7 @@ func TestListGroupDeployTokens(t *testing.T) {
254254
t.Errorf("DeployTokens.ListGroupDeployTokens returned an error: %v", err)
255255
}
256256

257-
wantExpiresAt := time.Date(2020, 02, 14, 0, 0, 0, 0, time.UTC)
257+
wantExpiresAt := time.Date(2020, 0o2, 14, 0, 0, 0, 0, time.UTC)
258258

259259
want := []*DeployToken{
260260
{
@@ -298,7 +298,7 @@ func TestGetGroupDeployTokens(t *testing.T) {
298298
t.Errorf("DeployTokens.GetGroupDeployToken returned an error: %v", err)
299299
}
300300

301-
wantExpiresAt := time.Date(2020, 02, 14, 0, 0, 0, 0, time.UTC)
301+
wantExpiresAt := time.Date(2020, 0o2, 14, 0, 0, 0, 0, time.UTC)
302302

303303
want := &DeployToken{
304304
ID: 1,
@@ -335,7 +335,7 @@ func TestCreateGroupDeployToken(t *testing.T) {
335335
`)
336336
})
337337

338-
expiresAt := time.Date(2021, 01, 01, 0, 0, 0, 0, time.UTC)
338+
expiresAt := time.Date(2021, 0o1, 0o1, 0, 0, 0, 0, time.UTC)
339339

340340
deployToken, _, err := client.DeployTokens.CreateGroupDeployToken(5, &CreateGroupDeployTokenOptions{
341341
Name: String("My deploy token"),

deployments_merge_requests.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
//
21
// Copyright 2022, Daniela Filipe Bento
32
//
43
// Licensed under the Apache License, Version 2.0 (the "License");
54
// you may not use this file except in compliance with the License.
65
// You may obtain a copy of the License at
76
//
8-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
98
//
109
// Unless required by applicable law or agreed to in writing, software
1110
// distributed under the License is distributed on an "AS IS" BASIS,

event_parsing.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@ func ParseSystemhook(payload []byte) (event interface{}, err error) {
148148
"group_destroy",
149149
"group_rename":
150150
event = &GroupSystemEvent{}
151-
case
152-
"key_create",
153-
"key_destroy":
151+
case "key_create", "key_destroy":
154152
event = &KeySystemEvent{}
155153
case
156154
"user_create",

event_parsing_systemhook_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func TestParseSystemhookRepositoryUpdate(t *testing.T) {
8383
}
8484

8585
func TestParseSystemhookProject(t *testing.T) {
86-
var tests = []struct {
86+
tests := []struct {
8787
event string
8888
payload []byte
8989
}{
@@ -109,7 +109,7 @@ func TestParseSystemhookProject(t *testing.T) {
109109
}
110110

111111
func TestParseSystemhookGroup(t *testing.T) {
112-
var tests = []struct {
112+
tests := []struct {
113113
event string
114114
payload []byte
115115
}{
@@ -133,7 +133,7 @@ func TestParseSystemhookGroup(t *testing.T) {
133133
}
134134

135135
func TestParseSystemhookUser(t *testing.T) {
136-
var tests = []struct {
136+
tests := []struct {
137137
event string
138138
payload []byte
139139
}{
@@ -158,7 +158,7 @@ func TestParseSystemhookUser(t *testing.T) {
158158
}
159159

160160
func TestParseSystemhookUserGroup(t *testing.T) {
161-
var tests = []struct {
161+
tests := []struct {
162162
event string
163163
payload []byte
164164
}{
@@ -182,7 +182,7 @@ func TestParseSystemhookUserGroup(t *testing.T) {
182182
}
183183

184184
func TestParseSystemhookUserTeam(t *testing.T) {
185-
var tests = []struct {
185+
tests := []struct {
186186
event string
187187
payload []byte
188188
}{

examples/impersonation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func impersonationExample() {
3030

3131
uid := 1
3232

33-
//list impersonation token from an user
33+
// list impersonation token from an user
3434
tokens, _, err := git.Users.GetAllImpersonationTokens(
3535
uid,
3636
&gitlab.GetAllImpersonationTokensOptions{State: gitlab.String("active")},
@@ -43,7 +43,7 @@ func impersonationExample() {
4343
log.Printf("Found token: %s", token.Token)
4444
}
4545

46-
//create an impersonation token of an user
46+
// create an impersonation token of an user
4747
token, _, err := git.Users.CreateImpersonationToken(
4848
uid,
4949
&gitlab.CreateImpersonationTokenOptions{Scopes: &[]string{"api"}},

gitlab_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ func testMethod(t *testing.T, r *http.Request, want string) {
7575
func testBody(t *testing.T, r *http.Request, want string) {
7676
buffer := new(bytes.Buffer)
7777
_, err := buffer.ReadFrom(r.Body)
78-
7978
if err != nil {
8079
t.Fatalf("Failed to Read Body: %v", err)
8180
}

group_boards_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ func TestGroupIssueBoardsService_ListGroupIssueBoards(t *testing.T) {
103103
Description: "",
104104
},
105105
Position: 3,
106-
}},
106+
},
107+
},
107108
}}
108109

109110
gibs, resp, err := client.GroupIssueBoards.ListGroupIssueBoards(5, nil, nil)
@@ -277,7 +278,8 @@ func TestGroupIssueBoardsService_GetGroupIssueBoard(t *testing.T) {
277278
Description: "",
278279
},
279280
Position: 3,
280-
}},
281+
},
282+
},
281283
}
282284

283285
gib, resp, err := client.GroupIssueBoards.GetGroupIssueBoard(5, 1, nil, nil)

group_labels_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ func TestCreateGroupGroupLabel(t *testing.T) {
3737
Color: String("#11FF22"),
3838
}
3939
label, _, err := client.GroupLabels.CreateGroupLabel("1", l)
40-
4140
if err != nil {
4241
log.Fatal(err)
4342
}

group_milestones_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,8 @@ func TestGroupMilestonesService_GetGroupMilestoneMergeRequests(t *testing.T) {
480480
Title: "v2.0",
481481
Description: "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
482482
State: "closed",
483-
WebURL: "https://gitlab.example.com/my-group/my-project/milestones/1"},
483+
WebURL: "https://gitlab.example.com/my-group/my-project/milestones/1",
484+
},
484485
MergeWhenPipelineSucceeds: true,
485486
DetailedMergeStatus: "mergeable",
486487
MergeError: "",
@@ -490,7 +491,8 @@ func TestGroupMilestonesService_GetGroupMilestoneMergeRequests(t *testing.T) {
490491
Name: "Douwe Maan",
491492
State: "active",
492493
AvatarURL: "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
493-
WebURL: "https://gitlab.com/DouweM"},
494+
WebURL: "https://gitlab.com/DouweM",
495+
},
494496
Subscribed: false,
495497
SHA: "8888888888888888888888888888888888888888",
496498
MergeCommitSHA: "",

group_variables_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ func TestGetGroupVariable(t *testing.T) {
6161
})
6262

6363
variable, _, err := client.GroupVariables.GetVariable(1, "TEST_VARIABLE_1")
64-
6564
if err != nil {
6665
t.Errorf("GroupVariables.GetVariable returned error: %v", err)
6766
}

0 commit comments

Comments
 (0)