From 85380ae1885274816536e2d73ba7c4a03a9870e2 Mon Sep 17 00:00:00 2001 From: A N V Satyanarayana Kolluri Date: Thu, 10 Oct 2024 14:08:31 +0530 Subject: [PATCH] Enhancement - make user contributed projects endpoint configurable --- projects.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/projects.go b/projects.go index 36f948509..e16f012b4 100644 --- a/projects.go +++ b/projects.go @@ -26,6 +26,10 @@ import ( "github.com/hashicorp/go-retryablehttp" ) +var ( + UserContributedProjectsEndpoint = "users/%s/contributed_projects" +) + // ProjectsService handles communication with the repositories related methods // of the GitLab API. // @@ -410,7 +414,7 @@ func (s *ProjectsService) ListUserContributedProjects(uid interface{}, opt *List if err != nil { return nil, nil, err } - u := fmt.Sprintf("users/%s/contributed_projects", user) + u := fmt.Sprintf(UserContributedProjectsEndpoint, user) req, err := s.client.NewRequest(http.MethodGet, u, opt, options) if err != nil {