Repository: google/go-github
File: github/users_social_accounts.go (Go)

Code before:
	u := "user/social_accounts"
	u, err := addOptions(u, opts)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var socialAccounts []*SocialAccount
	resp, err := s.client.Do(ctx, req, &socialAccounts)
	if err != nil {
		return nil, resp, err
	}

	return socialAccounts, resp, nil
}

// AddSocialAccounts adds social accounts for the authenticated user.
//
// GitHub API docs: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user
//
//meta:operation POST /user/social_accounts
func (s *UsersService) AddSocialAccounts(ctx context.Context, accountURLsToAdd []string) ([]*SocialAccount, *Response, error) {
	u := "user/social_accounts"
	req, err := s.client.NewRequest("POST", u, accountURLsToAdd)
	if err != nil {
		return nil, nil, err
	}

	var addedAccounts []*SocialAccount
	resp, err := s.client.Do(ctx, req, &addedAccounts)
	if err != nil {
		return nil, resp, err
	}

	return addedAccounts, resp, nil
}

// DeleteSocialAccounts deletes social accounts for the authenticated user.
//
// GitHub API docs: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user
//
//meta:operation DELETE /user/social_accounts
func (s *UsersService) DeleteSocialAccounts(ctx context.Context, accountsToDelete []string) (*Response, error) {
	u := "user/social_accounts"
	req, err := s.client.NewRequest("DELETE", u, accountsToDelete)
	if err != nil {
		return nil, err

Review comment (refactor):
Let's simplify naming:
```suggestion
func (s *UsersService) AddSocialAccounts(ctx context.Context, accountURLs []string) ([]*SocialAccount, *Response, error) {
```

Code after:
	u := "user/social_accounts"
	u, err := addOptions(u, opts)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var socialAccounts []*SocialAccount
	resp, err := s.client.Do(ctx, req, &socialAccounts)
	if err != nil {
		return nil, resp, err
	}

	return socialAccounts, resp, nil
}

// AddSocialAccounts adds social accounts for the authenticated user.
//
// GitHub API docs: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user
//
//meta:operation POST /user/social_accounts
func (s *UsersService) AddSocialAccounts(ctx context.Context, accountURLs []string) ([]*SocialAccount, *Response, error) {
	u := "user/social_accounts"
	req, err := s.client.NewRequest("POST", u, accountURLs)
	if err != nil {
		return nil, nil, err
	}

	var accounts []*SocialAccount
	resp, err := s.client.Do(ctx, req, &accounts)
	if err != nil {
		return nil, resp, err
	}

	return accounts, resp, nil
}

// DeleteSocialAccounts deletes social accounts for the authenticated user.
//
// GitHub API docs: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user
//
//meta:operation DELETE /user/social_accounts
func (s *UsersService) DeleteSocialAccounts(ctx context.Context, accountURLs []string) (*Response, error) {
	u := "user/social_accounts"
	req, err := s.client.NewRequest("DELETE", u, accountURLs)
	if err != nil {
		return nil, err