Skip to content

Commit 3ac36fa

Browse files
committed
Expose PathEscape.
1 parent f8ceb06 commit 3ac36fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+576
-568
lines changed

access_requests.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (s *AccessRequestsService) ListProjectAccessRequests(pid interface{}, opt *
6161
if err != nil {
6262
return nil, nil, err
6363
}
64-
u := fmt.Sprintf("projects/%s/access_requests", pathEscape(project))
64+
u := fmt.Sprintf("projects/%s/access_requests", PathEscape(project))
6565

6666
req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
6767
if err != nil {
@@ -87,7 +87,7 @@ func (s *AccessRequestsService) ListGroupAccessRequests(gid interface{}, opt *Li
8787
if err != nil {
8888
return nil, nil, err
8989
}
90-
u := fmt.Sprintf("groups/%s/access_requests", pathEscape(group))
90+
u := fmt.Sprintf("groups/%s/access_requests", PathEscape(group))
9191

9292
req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
9393
if err != nil {
@@ -113,7 +113,7 @@ func (s *AccessRequestsService) RequestProjectAccess(pid interface{}, options ..
113113
if err != nil {
114114
return nil, nil, err
115115
}
116-
u := fmt.Sprintf("projects/%s/access_requests", pathEscape(project))
116+
u := fmt.Sprintf("projects/%s/access_requests", PathEscape(project))
117117

118118
req, err := s.client.NewRequest(http.MethodPost, u, nil, options)
119119
if err != nil {
@@ -139,7 +139,7 @@ func (s *AccessRequestsService) RequestGroupAccess(gid interface{}, options ...R
139139
if err != nil {
140140
return nil, nil, err
141141
}
142-
u := fmt.Sprintf("groups/%s/access_requests", pathEscape(group))
142+
u := fmt.Sprintf("groups/%s/access_requests", PathEscape(group))
143143

144144
req, err := s.client.NewRequest(http.MethodPost, u, nil, options)
145145
if err != nil {
@@ -173,7 +173,7 @@ func (s *AccessRequestsService) ApproveProjectAccessRequest(pid interface{}, use
173173
if err != nil {
174174
return nil, nil, err
175175
}
176-
u := fmt.Sprintf("projects/%s/access_requests/%d/approve", pathEscape(project), user)
176+
u := fmt.Sprintf("projects/%s/access_requests/%d/approve", PathEscape(project), user)
177177

178178
req, err := s.client.NewRequest(http.MethodPut, u, opt, options)
179179
if err != nil {
@@ -198,7 +198,7 @@ func (s *AccessRequestsService) ApproveGroupAccessRequest(gid interface{}, user
198198
if err != nil {
199199
return nil, nil, err
200200
}
201-
u := fmt.Sprintf("groups/%s/access_requests/%d/approve", pathEscape(group), user)
201+
u := fmt.Sprintf("groups/%s/access_requests/%d/approve", PathEscape(group), user)
202202

203203
req, err := s.client.NewRequest(http.MethodPut, u, opt, options)
204204
if err != nil {
@@ -223,7 +223,7 @@ func (s *AccessRequestsService) DenyProjectAccessRequest(pid interface{}, user i
223223
if err != nil {
224224
return nil, err
225225
}
226-
u := fmt.Sprintf("projects/%s/access_requests/%d", pathEscape(project), user)
226+
u := fmt.Sprintf("projects/%s/access_requests/%d", PathEscape(project), user)
227227

228228
req, err := s.client.NewRequest(http.MethodDelete, u, nil, options)
229229
if err != nil {
@@ -242,7 +242,7 @@ func (s *AccessRequestsService) DenyGroupAccessRequest(gid interface{}, user int
242242
if err != nil {
243243
return nil, err
244244
}
245-
u := fmt.Sprintf("groups/%s/access_requests/%d", pathEscape(group), user)
245+
u := fmt.Sprintf("groups/%s/access_requests/%d", PathEscape(group), user)
246246

247247
req, err := s.client.NewRequest(http.MethodDelete, u, nil, options)
248248
if err != nil {

audit_events.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (s *AuditEventsService) ListGroupAuditEvents(gid interface{}, opt *ListAudi
108108
if err != nil {
109109
return nil, nil, err
110110
}
111-
u := fmt.Sprintf("groups/%s/audit_events", pathEscape(group))
111+
u := fmt.Sprintf("groups/%s/audit_events", PathEscape(group))
112112

113113
req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
114114
if err != nil {
@@ -132,7 +132,7 @@ func (s *AuditEventsService) GetGroupAuditEvent(gid interface{}, event int, opti
132132
if err != nil {
133133
return nil, nil, err
134134
}
135-
u := fmt.Sprintf("groups/%s/audit_events/%d", pathEscape(group), event)
135+
u := fmt.Sprintf("groups/%s/audit_events/%d", PathEscape(group), event)
136136

137137
req, err := s.client.NewRequest(http.MethodGet, u, nil, options)
138138
if err != nil {
@@ -157,7 +157,7 @@ func (s *AuditEventsService) ListProjectAuditEvents(pid interface{}, opt *ListAu
157157
if err != nil {
158158
return nil, nil, err
159159
}
160-
u := fmt.Sprintf("projects/%s/audit_events", pathEscape(project))
160+
u := fmt.Sprintf("projects/%s/audit_events", PathEscape(project))
161161

162162
req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
163163
if err != nil {
@@ -182,7 +182,7 @@ func (s *AuditEventsService) GetProjectAuditEvent(pid interface{}, event int, op
182182
if err != nil {
183183
return nil, nil, err
184184
}
185-
u := fmt.Sprintf("projects/%s/audit_events/%d", pathEscape(project), event)
185+
u := fmt.Sprintf("projects/%s/audit_events/%d", PathEscape(project), event)
186186

187187
req, err := s.client.NewRequest(http.MethodGet, u, nil, options)
188188
if err != nil {

award_emojis.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (s *AwardEmojiService) listAwardEmoji(pid interface{}, resource string, res
9393
return nil, nil, err
9494
}
9595
u := fmt.Sprintf("projects/%s/%s/%d/award_emoji",
96-
pathEscape(project),
96+
PathEscape(project),
9797
resource,
9898
resourceID,
9999
)
@@ -142,7 +142,7 @@ func (s *AwardEmojiService) getAwardEmoji(pid interface{}, resource string, reso
142142
return nil, nil, err
143143
}
144144
u := fmt.Sprintf("projects/%s/%s/%d/award_emoji/%d",
145-
pathEscape(project),
145+
PathEscape(project),
146146
resource,
147147
resourceID,
148148
awardID,
@@ -201,7 +201,7 @@ func (s *AwardEmojiService) createAwardEmoji(pid interface{}, resource string, r
201201
return nil, nil, err
202202
}
203203
u := fmt.Sprintf("projects/%s/%s/%d/award_emoji",
204-
pathEscape(project),
204+
PathEscape(project),
205205
resource,
206206
resourceID,
207207
)
@@ -253,7 +253,7 @@ func (s *AwardEmojiService) deleteAwardEmoji(pid interface{}, resource string, r
253253
if err != nil {
254254
return nil, err
255255
}
256-
u := fmt.Sprintf("projects/%s/%s/%d/award_emoji/%d", pathEscape(project), resource,
256+
u := fmt.Sprintf("projects/%s/%s/%d/award_emoji/%d", PathEscape(project), resource,
257257
resourceID, awardID)
258258

259259
req, err := s.client.NewRequest(http.MethodDelete, u, nil, options)
@@ -295,7 +295,7 @@ func (s *AwardEmojiService) listAwardEmojiOnNote(pid interface{}, resources stri
295295
if err != nil {
296296
return nil, nil, err
297297
}
298-
u := fmt.Sprintf("projects/%s/%s/%d/notes/%d/award_emoji", pathEscape(project), resources,
298+
u := fmt.Sprintf("projects/%s/%s/%d/notes/%d/award_emoji", PathEscape(project), resources,
299299
ressourceID, noteID)
300300

301301
req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
@@ -344,7 +344,7 @@ func (s *AwardEmojiService) getSingleNoteAwardEmoji(pid interface{}, ressource s
344344
return nil, nil, err
345345
}
346346
u := fmt.Sprintf("projects/%s/%s/%d/notes/%d/award_emoji/%d",
347-
pathEscape(project),
347+
PathEscape(project),
348348
ressource,
349349
resourceID,
350350
noteID,
@@ -400,7 +400,7 @@ func (s *AwardEmojiService) createAwardEmojiOnNote(pid interface{}, resource str
400400
return nil, nil, err
401401
}
402402
u := fmt.Sprintf("projects/%s/%s/%d/notes/%d/award_emoji",
403-
pathEscape(project),
403+
PathEscape(project),
404404
resource,
405405
resourceID,
406406
noteID,
@@ -452,7 +452,7 @@ func (s *AwardEmojiService) deleteAwardEmojiOnNote(pid interface{}, resource str
452452
return nil, err
453453
}
454454
u := fmt.Sprintf("projects/%s/%s/%d/notes/%d/award_emoji/%d",
455-
pathEscape(project),
455+
PathEscape(project),
456456
resource,
457457
resourceID,
458458
noteID,

boards.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (s *IssueBoardsService) CreateIssueBoard(pid interface{}, opt *CreateIssueB
7272
if err != nil {
7373
return nil, nil, err
7474
}
75-
u := fmt.Sprintf("projects/%s/boards", pathEscape(project))
75+
u := fmt.Sprintf("projects/%s/boards", PathEscape(project))
7676

7777
req, err := s.client.NewRequest(http.MethodPost, u, opt, options)
7878
if err != nil {
@@ -107,7 +107,7 @@ func (s *IssueBoardsService) UpdateIssueBoard(pid interface{}, board int, opt *U
107107
if err != nil {
108108
return nil, nil, err
109109
}
110-
u := fmt.Sprintf("projects/%s/boards/%d", pathEscape(project), board)
110+
u := fmt.Sprintf("projects/%s/boards/%d", PathEscape(project), board)
111111

112112
req, err := s.client.NewRequest(http.MethodPut, u, opt, options)
113113
if err != nil {
@@ -131,7 +131,7 @@ func (s *IssueBoardsService) DeleteIssueBoard(pid interface{}, board int, option
131131
if err != nil {
132132
return nil, err
133133
}
134-
u := fmt.Sprintf("projects/%s/boards/%d", pathEscape(project), board)
134+
u := fmt.Sprintf("projects/%s/boards/%d", PathEscape(project), board)
135135

136136
req, err := s.client.NewRequest(http.MethodDelete, u, nil, options)
137137
if err != nil {
@@ -154,7 +154,7 @@ func (s *IssueBoardsService) ListIssueBoards(pid interface{}, opt *ListIssueBoar
154154
if err != nil {
155155
return nil, nil, err
156156
}
157-
u := fmt.Sprintf("projects/%s/boards", pathEscape(project))
157+
u := fmt.Sprintf("projects/%s/boards", PathEscape(project))
158158

159159
req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
160160
if err != nil {
@@ -178,7 +178,7 @@ func (s *IssueBoardsService) GetIssueBoard(pid interface{}, board int, options .
178178
if err != nil {
179179
return nil, nil, err
180180
}
181-
u := fmt.Sprintf("projects/%s/boards/%d", pathEscape(project), board)
181+
u := fmt.Sprintf("projects/%s/boards/%d", PathEscape(project), board)
182182

183183
req, err := s.client.NewRequest(http.MethodGet, u, nil, options)
184184
if err != nil {
@@ -208,7 +208,7 @@ func (s *IssueBoardsService) GetIssueBoardLists(pid interface{}, board int, opt
208208
if err != nil {
209209
return nil, nil, err
210210
}
211-
u := fmt.Sprintf("projects/%s/boards/%d/lists", pathEscape(project), board)
211+
u := fmt.Sprintf("projects/%s/boards/%d/lists", PathEscape(project), board)
212212

213213
req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
214214
if err != nil {
@@ -233,7 +233,7 @@ func (s *IssueBoardsService) GetIssueBoardList(pid interface{}, board, list int,
233233
return nil, nil, err
234234
}
235235
u := fmt.Sprintf("projects/%s/boards/%d/lists/%d",
236-
pathEscape(project),
236+
PathEscape(project),
237237
board,
238238
list,
239239
)
@@ -268,7 +268,7 @@ func (s *IssueBoardsService) CreateIssueBoardList(pid interface{}, board int, op
268268
if err != nil {
269269
return nil, nil, err
270270
}
271-
u := fmt.Sprintf("projects/%s/boards/%d/lists", pathEscape(project), board)
271+
u := fmt.Sprintf("projects/%s/boards/%d/lists", PathEscape(project), board)
272272

273273
req, err := s.client.NewRequest(http.MethodPost, u, opt, options)
274274
if err != nil {
@@ -301,7 +301,7 @@ func (s *IssueBoardsService) UpdateIssueBoardList(pid interface{}, board, list i
301301
return nil, nil, err
302302
}
303303
u := fmt.Sprintf("projects/%s/boards/%d/lists/%d",
304-
pathEscape(project),
304+
PathEscape(project),
305305
board,
306306
list,
307307
)
@@ -331,7 +331,7 @@ func (s *IssueBoardsService) DeleteIssueBoardList(pid interface{}, board, list i
331331
return nil, err
332332
}
333333
u := fmt.Sprintf("projects/%s/boards/%d/lists/%d",
334-
pathEscape(project),
334+
PathEscape(project),
335335
board,
336336
list,
337337
)

branches.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (s *BranchesService) ListBranches(pid interface{}, opts *ListBranchesOption
6868
if err != nil {
6969
return nil, nil, err
7070
}
71-
u := fmt.Sprintf("projects/%s/repository/branches", pathEscape(project))
71+
u := fmt.Sprintf("projects/%s/repository/branches", PathEscape(project))
7272

7373
req, err := s.client.NewRequest(http.MethodGet, u, opts, options)
7474
if err != nil {
@@ -93,7 +93,7 @@ func (s *BranchesService) GetBranch(pid interface{}, branch string, options ...R
9393
if err != nil {
9494
return nil, nil, err
9595
}
96-
u := fmt.Sprintf("projects/%s/repository/branches/%s", pathEscape(project), url.PathEscape(branch))
96+
u := fmt.Sprintf("projects/%s/repository/branches/%s", PathEscape(project), url.PathEscape(branch))
9797

9898
req, err := s.client.NewRequest(http.MethodGet, u, nil, options)
9999
if err != nil {
@@ -129,7 +129,7 @@ func (s *BranchesService) ProtectBranch(pid interface{}, branch string, opts *Pr
129129
if err != nil {
130130
return nil, nil, err
131131
}
132-
u := fmt.Sprintf("projects/%s/repository/branches/%s/protect", pathEscape(project), url.PathEscape(branch))
132+
u := fmt.Sprintf("projects/%s/repository/branches/%s/protect", PathEscape(project), url.PathEscape(branch))
133133

134134
req, err := s.client.NewRequest(http.MethodPut, u, opts, options)
135135
if err != nil {
@@ -156,7 +156,7 @@ func (s *BranchesService) UnprotectBranch(pid interface{}, branch string, option
156156
if err != nil {
157157
return nil, nil, err
158158
}
159-
u := fmt.Sprintf("projects/%s/repository/branches/%s/unprotect", pathEscape(project), url.PathEscape(branch))
159+
u := fmt.Sprintf("projects/%s/repository/branches/%s/unprotect", PathEscape(project), url.PathEscape(branch))
160160

161161
req, err := s.client.NewRequest(http.MethodPut, u, nil, options)
162162
if err != nil {
@@ -190,7 +190,7 @@ func (s *BranchesService) CreateBranch(pid interface{}, opt *CreateBranchOptions
190190
if err != nil {
191191
return nil, nil, err
192192
}
193-
u := fmt.Sprintf("projects/%s/repository/branches", pathEscape(project))
193+
u := fmt.Sprintf("projects/%s/repository/branches", PathEscape(project))
194194

195195
req, err := s.client.NewRequest(http.MethodPost, u, opt, options)
196196
if err != nil {
@@ -215,7 +215,7 @@ func (s *BranchesService) DeleteBranch(pid interface{}, branch string, options .
215215
if err != nil {
216216
return nil, err
217217
}
218-
u := fmt.Sprintf("projects/%s/repository/branches/%s", pathEscape(project), url.PathEscape(branch))
218+
u := fmt.Sprintf("projects/%s/repository/branches/%s", PathEscape(project), url.PathEscape(branch))
219219

220220
req, err := s.client.NewRequest(http.MethodDelete, u, nil, options)
221221
if err != nil {
@@ -234,7 +234,7 @@ func (s *BranchesService) DeleteMergedBranches(pid interface{}, options ...Reque
234234
if err != nil {
235235
return nil, err
236236
}
237-
u := fmt.Sprintf("projects/%s/repository/merged_branches", pathEscape(project))
237+
u := fmt.Sprintf("projects/%s/repository/merged_branches", PathEscape(project))
238238

239239
req, err := s.client.NewRequest(http.MethodDelete, u, nil, options)
240240
if err != nil {

ci_yml_templates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (s *CIYMLTemplatesService) ListAllTemplates(opt *ListCIYMLTemplatesOptions,
6969
// GitLab API docs:
7070
// https://docs.gitlab.com/ce/api/templates/gitlab_ci_ymls.html#single-gitlab-ci-yml-template
7171
func (s *CIYMLTemplatesService) GetTemplate(key string, options ...RequestOptionFunc) (*CIYMLTemplate, *Response, error) {
72-
u := fmt.Sprintf("templates/gitlab_ci_ymls/%s", pathEscape(key))
72+
u := fmt.Sprintf("templates/gitlab_ci_ymls/%s", PathEscape(key))
7373

7474
req, err := s.client.NewRequest(http.MethodGet, u, nil, options)
7575
if err != nil {

0 commit comments

Comments
 (0)