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

Code before:
	req, err := s.client.NewRequest("POST", u, &opts)
	if err != nil {
		return nil, nil, err
	}

	r := new(Repository)
	resp, err := s.client.Do(ctx, req, r)
	if err != nil {
		return nil, resp, err
	}

	return r, resp, nil
}

// isBranchNotProtected determines whether a branch is not protected
// based on the error message returned by GitHub API.
func isBranchNotProtected(err error) bool {
	errorResponse, ok := err.(*ErrorResponse)
	return ok && errorResponse.Message == githubBranchNotProtected
}

// EnablePrivateReporting enables private reporting of vulnerabilities for a
// repository.
//
// Github API docs: https://docs.github.com/en/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository
func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner string, repo string) (*Response, error) {
	u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo)

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

	resp, err := s.client.Do(ctx, req, nil)
	if err != nil {
		return resp, err
	}

	return resp, nil
}

// DisablePrivateReporting disables private reporting of vulnerabilities for a
// repository.
//
// Github API docs: https://docs.github.com/en/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository
func (s *RepositoriesService) DisablePrivateReporting(ctx context.Context, owner string, repo string) (*Response, error) {
	u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo)

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

Review comment (suggestion):
```suggestion
func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) {
```

Code after:
	req, err := s.client.NewRequest("POST", u, &opts)
	if err != nil {
		return nil, nil, err
	}

	r := new(Repository)
	resp, err := s.client.Do(ctx, req, r)
	if err != nil {
		return nil, resp, err
	}

	return r, resp, nil
}

// isBranchNotProtected determines whether a branch is not protected
// based on the error message returned by GitHub API.
func isBranchNotProtected(err error) bool {
	errorResponse, ok := err.(*ErrorResponse)
	return ok && errorResponse.Message == githubBranchNotProtected
}

// EnablePrivateReporting enables private reporting of vulnerabilities for a
// repository.
//
// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository
func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) {
	u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo)

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

	resp, err := s.client.Do(ctx, req, nil)
	if err != nil {
		return resp, err
	}

	return resp, nil
}

// DisablePrivateReporting disables private reporting of vulnerabilities for a
// repository.
//
// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository
func (s *RepositoriesService) DisablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) {
	u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo)

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