code: func (c *githubAPIClient) getTeams() ([]teamResponse, error) {
  	var result []teamResponse
  
  	bytes, nextPage, err := c.get("/user/teams")
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  
  	// Extract the first page of results and append them to the full result set.
  	var teams []teamResponse
  	err = json.Unmarshal(bytes, &teams)
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  	result = append(result, teams...)
  
  	// If the response returned a next page link, continue following the next
  	// page links until all teams have been retrieved.
  	var count int
  	for nextPage != "" {
  		// To prevent this from looping forever, don't fetch more than a set number
  		// of pages, print an error when it does happen, and return the results up
  		// to that point.
  		if count > MaxPages {
  			warningMessage := "Truncating list of teams used to populate claims: " +
  				"hit maximum number pages that can be fetched from GitHub."
  
  			// Print warning to Teleport logs as well as the Audit Log.
  			log.Warnf(warningMessage)
  			c.authServer.EmitAuditEvent(events.UserSSOLoginFailure, events.EventFields{
  				events.LoginMethod:        events.LoginMethodGithub,
  				events.AuthAttemptMessage: warningMessage,
  			})
  
  			return result, nil
  		}
  
  		u, err := url.Parse(nextPage)
  		if err != nil {
  			return nil, trace.Wrap(err)
  		}
  
  		bytes, nextPage, err = c.get(u.RequestURI())
  		if err != nil {
  			return nil, trace.Wrap(err)
  		}
  
  		err = json.Unmarshal(bytes, &teams)
  		if err != nil {
  			return nil, trace.Wrap(err)
  		}
  
  		// Append this page of teams to full result set.
  		result = append(result, teams...)
  
  		count = count + 1
  	}
  
  	return result, nil
  }
docs: // getTeams retrieves a list of teams authenticated user belongs to.