@@ -213,61 +213,6 @@ func (e *unconvertibleIdError) Error() string {
213213 e .OriginalId , e .OriginalError .Error ())
214214}
215215
216- func getTeamID (teamIDString string , meta any ) (int64 , error ) {
217- // Given a string that is either a team id or team slug, return the
218- // id of the team it is referring to.
219- ctx := context .Background ()
220- client := meta .(* Owner ).v3client
221- orgName := meta .(* Owner ).name
222-
223- teamId , parseIntErr := strconv .ParseInt (teamIDString , 10 , 64 )
224- if parseIntErr == nil {
225- return teamId , nil
226- }
227-
228- // The given id not an integer, assume it is a team slug
229- team , _ , slugErr := client .Teams .GetTeamBySlug (ctx , orgName , teamIDString )
230- if slugErr != nil {
231- return - 1 , errors .New (parseIntErr .Error () + slugErr .Error ())
232- }
233- return team .GetID (), nil
234- }
235-
236- func getTeamSlug (teamIDString string , meta any ) (string , error ) {
237- ctx := context .Background ()
238- return getTeamSlugContext (ctx , teamIDString , meta )
239- }
240-
241- func getTeamSlugContext (ctx context.Context , teamIDString string , meta any ) (string , error ) {
242- // Given a string that is either a team id or team slug, return the
243- // team slug it is referring to.
244- client := meta .(* Owner ).v3client
245- orgName := meta .(* Owner ).name
246- orgId := meta .(* Owner ).id
247-
248- teamId , parseIntErr := strconv .ParseInt (teamIDString , 10 , 64 )
249- if parseIntErr != nil {
250- // The given id not an integer, assume it is a team slug
251- team , _ , slugErr := client .Teams .GetTeamBySlug (ctx , orgName , teamIDString )
252- if slugErr != nil {
253- return "" , errors .New (parseIntErr .Error () + slugErr .Error ())
254- }
255- return team .GetSlug (), nil
256- }
257-
258- // The given id is an integer, assume it is a team id
259- team , _ , teamIdErr := client .Teams .GetTeamByID (ctx , orgId , teamId )
260- if teamIdErr != nil {
261- // There isn't a team with the given ID, assume it is a teamslug
262- team , _ , slugErr := client .Teams .GetTeamBySlug (ctx , orgName , teamIDString )
263- if slugErr != nil {
264- return "" , errors .New (teamIdErr .Error () + slugErr .Error ())
265- }
266- return team .GetSlug (), nil
267- }
268- return team .GetSlug (), nil
269- }
270-
271216// errIs404 checks if the error is a GitHub 404 Not Found response.
272217func errIs404 (err error ) bool {
273218 var ghErr * github.ErrorResponse
0 commit comments