ronantakizawa/codereview-bench huggingface dataset:
Repository: google/go-github
File: github/github_test.go (Go)

Code before:
}

func TestPtr(t *testing.T) {
	t.Parallel()
	equal := func(t *testing.T, want, got any) {
		t.Helper()
		if !reflect.DeepEqual(want, got) {
			t.Errorf("want %#v, got %#v", want, got)
		}
	}

	equal(t, true, *Ptr(true))
	equal(t, int(10), *Ptr(int(10)))
	equal(t, int64(-10), *Ptr(int64(-10)))
	equal(t, "str", *Ptr("str"))
}

func TestDeploymentProtectionRuleEvent_GetRunID(t *testing.T) {
	t.Parallel()
	tests := []struct {
		want int64
		URL   string
	}{
		{
			want: 123456789,
			URL:   fmt.Sprintf("repos/dummy-org/dummy-repo/actions/runs/%v/deployment_protection_rule", 123456789),
		},
		{
			want: ,
			URL:   fmt.Sprintf("repos/dummy-org/dummy-repo/actions/runs/%v/deployment_protection_rule", "abc123"),
		},
	}
	for _, tt := range tests {

		e := DeploymentProtectionRuleEvent{
			DeploymentCallbackURL: &tt.URL,
		}
		got, err := e.GetRunID()
		if err != nil {
			t.Errorf("error %v", err)
		}
		if got != tt.want {
			t.Errorf("want %#v, got %#v", tt.want, got)
		}
	}
}


Review comment (suggestion):
```suggestion
			URL:   "repos/dummy-org/dummy-repo/actions/runs/123456789/deployment_protection_rule",
```

Code after:
}

func TestPtr(t *testing.T) {
	t.Parallel()
	equal := func(t *testing.T, want, got any) {
		t.Helper()
		if !reflect.DeepEqual(want, got) {
			t.Errorf("want %#v, got %#v", want, got)
		}
	}

	equal(t, true, *Ptr(true))
	equal(t, int(10), *Ptr(int(10)))
	equal(t, int64(-10), *Ptr(int64(-10)))
	equal(t, "str", *Ptr("str"))
}

func TestDeploymentProtectionRuleEvent_GetRunID(t *testing.T) {
	t.Parallel()

	var want int64 = 123456789
	url := "repos/dummy-org/dummy-repo/actions/runs/123456789/deployment_protection_rule"

	e := DeploymentProtectionRuleEvent{
		DeploymentCallbackURL: &url,
	}

	got, _ := e.GetRunID()
	if got != want {
		t.Errorf("want %#v, got %#v", want, got)
	}

	want = -1
	url = "repos/dummy-org/dummy-repo/actions/runs/abc123/deployment_protection_rule"

	got, err := e.GetRunID()
	if err == nil {
		t.Errorf("Expected error to be returned")
	}

	if got != want {
		t.Errorf("want %#v, got %#v", want, got)
	}
}
Repository: google/go-github
File: github/github_test.go (Go)

Code before:
	equal := func(t *testing.T, want, got any) {
		t.Helper()
		if !reflect.DeepEqual(want, got) {
			t.Errorf("want %#v, got %#v", want, got)
		}
	}

	equal(t, true, *Ptr(true))
	equal(t, int(10), *Ptr(int(10)))
	equal(t, int64(-10), *Ptr(int64(-10)))
	equal(t, "str", *Ptr("str"))
}

func TestDeploymentProtectionRuleEvent_GetRunID(t *testing.T) {
	t.Parallel()
	tests := []struct {
		want int64
		URL   string
	}{
		{
			want: 123456789,
			URL:   fmt.Sprintf("repos/dummy-org/dummy-repo/actions/runs/%v/deployment_protection_rule", 123456789),
		},
		{
			want: ,
			URL:   fmt.Sprintf("repos/dummy-org/dummy-repo/actions/runs/%v/deployment_protection_rule", "abc123"),
		},
	}
	for _, tt := range tests {

		e := DeploymentProtectionRuleEvent{
			DeploymentCallbackURL: &tt.URL,
		}
		got, err := e.GetRunID()
		if err != nil {
			t.Errorf("error %v", err)
		}
		if got != tt.want {
			t.Errorf("want %#v, got %#v", tt.want, got)
		}
	}
}


Review comment (suggestion):
```suggestion
			URL:   "repos/dummy-org/dummy-repo/actions/runs/abc123/deployment_protection_rule",
```

Code after:
	equal := func(t *testing.T, want, got any) {
		t.Helper()
		if !reflect.DeepEqual(want, got) {
			t.Errorf("want %#v, got %#v", want, got)
		}
	}

	equal(t, true, *Ptr(true))
	equal(t, int(10), *Ptr(int(10)))
	equal(t, int64(-10), *Ptr(int64(-10)))
	equal(t, "str", *Ptr("str"))
}

func TestDeploymentProtectionRuleEvent_GetRunID(t *testing.T) {
	t.Parallel()

	var want int64 = 123456789
	url := "repos/dummy-org/dummy-repo/actions/runs/123456789/deployment_protection_rule"

	e := DeploymentProtectionRuleEvent{
		DeploymentCallbackURL: &url,
	}

	got, _ := e.GetRunID()
	if got != want {
		t.Errorf("want %#v, got %#v", want, got)
	}

	want = -1
	url = "repos/dummy-org/dummy-repo/actions/runs/abc123/deployment_protection_rule"

	got, err := e.GetRunID()
	if err == nil {
		t.Errorf("Expected error to be returned")
	}

	if got != want {
		t.Errorf("want %#v, got %#v", want, got)
	}
}
Repository: google/go-github
File: github/github.go (Go)

Code before:
// Int is a helper routine that allocates a new int value
// to store v and returns a pointer to it.
//
// Deprecated: use Ptr instead.
func Int(v int) *int { return &v }

// Int64 is a helper routine that allocates a new int64 value
// to store v and returns a pointer to it.
//
// Deprecated: use Ptr instead.
func Int64(v int64) *int64 { return &v }

// String is a helper routine that allocates a new string value
// to store v and returns a pointer to it.
//
// Deprecated: use Ptr instead.
func String(v string) *string { return &v }

// roundTripperFunc creates a RoundTripper (transport).
type roundTripperFunc func(*http.Request) (*http.Response, error)

func (fn roundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) {
	return fn(r)
}

var r *regexp.Regexp = regexp.MustCompile(`^repos\/.*\/.*\/actions\/runs\/(\d+)\/deployment_protection_rule$`)

// Helper Function to extract the workflow RunID from the *DeploymentProtectionRuleEvent.DeploymentCallBackURL.
func (e *DeploymentProtectionRuleEvent) GetRunID() (int64, error) {
	match := r.FindStringSubmatch(*e.DeploymentCallbackURL)
	var ErrNoMatch = errors.New("no match found")
	if len(match) != 2 {
		return -1, ErrNoMatch
	}
	runID, err := strconv.ParseInt(match[1], 10, 64)
	if err != nil {
		return -1, err
	}
	return runID, nil
}


Review comment (suggestion):
Just out of curiosity... did you try without all the backslashes?

Does this still work?

```go
var r *regexp.Regexp = regexp.MustCompile(`^repos/.*/actions/runs/(\d+)/deployment_protection_rule$`)
```

Since `.*` will slurp up the intervening slash, we really only need one of them, I'm thinking.

Code after:
// Int is a helper routine that allocates a new int value
// to store v and returns a pointer to it.
//
// Deprecated: use Ptr instead.
func Int(v int) *int { return &v }

// Int64 is a helper routine that allocates a new int64 value
// to store v and returns a pointer to it.
//
// Deprecated: use Ptr instead.
func Int64(v int64) *int64 { return &v }

// String is a helper routine that allocates a new string value
// to store v and returns a pointer to it.
//
// Deprecated: use Ptr instead.
func String(v string) *string { return &v }

// roundTripperFunc creates a RoundTripper (transport).
type roundTripperFunc func(*http.Request) (*http.Response, error)

func (fn roundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) {
	return fn(r)
}

var runIDFromURLRE = regexp.MustCompile(`^repos/.*/actions/runs/(\d+)/deployment_protection_rule$`)

// GetRunID is a Helper Function used to extract the workflow RunID from the *DeploymentProtectionRuleEvent.DeploymentCallBackURL.
func (e *DeploymentProtectionRuleEvent) GetRunID() (int64, error) {
	match := runIDFromURLRE.FindStringSubmatch(*e.DeploymentCallbackURL)
	if len(match) != 2 {
		return -1, errors.New("no match")
	}
	runID, err := strconv.ParseInt(match[1], 10, 64)
	if err != nil {
		return -1, err
	}
	return runID, nil
}
Repository: google/go-github
File: github/github_test.go (Go)

Code before:
		}
	}

	equal(t, true, *Ptr(true))
	equal(t, int(10), *Ptr(int(10)))
	equal(t, int64(-10), *Ptr(int64(-10)))
	equal(t, "str", *Ptr("str"))
}

func TestDeploymentProtectionRuleEvent_GetRunID(t *testing.T) {
	t.Parallel()

	var want int64 = 123456789
	url := "https://api.github.com/repos/dummy-org/dummy-repo/actions/runs/123456789/deployment_protection_rule"

	e := DeploymentProtectionRuleEvent{
		DeploymentCallbackURL: &url,
	}

	got, _ := e.GetRunID()
	if got != want {
		t.Errorf("want %#v, got %#v", want, got)
	}

	want = 123456789
	url = "https://local.dummyhost.net/repos/dummy-org/dummy-repo/actions/runs/123456789/deployment_protection_rule"

	e = DeploymentProtectionRuleEvent{
		DeploymentCallbackURL: &url,
	}

	got, _ = e.GetRunID()
	if got != want {
		t.Errorf("want %#v, got %#v", want, got)
	}


	want = -1
	url = "https://api.github.com/repos/dummy-org/dummy-repo/actions/runs/abc123/deployment_protection_rule"
	got, err := e.GetRunID()
	if err == nil {
		t.Errorf("Expected error to be returned")
	}

	if got != want {
		t.Errorf("want %#v, got %#v", want, got)
	}
}


Review comment (suggestion):
Actually, on GitHub Enterprise, the URL comes back in the event without the base URL, like the following, so please change this line to represent that.

```suggestion
	// GitHub Enterprise returns the URL in events without the leading domain:
	url = "repos/dummy-org/dummy-repo/actions/runs/123456789/deployment_protection_rule"
```

Code after:
		}
	}

	equal(t, true, *Ptr(true))
	equal(t, int(10), *Ptr(int(10)))
	equal(t, int64(-10), *Ptr(int64(-10)))
	equal(t, "str", *Ptr("str"))
}

func TestDeploymentProtectionRuleEvent_GetRunID(t *testing.T) {
	t.Parallel()

	var want int64 = 123456789
	url := "https://api.github.com/repos/dummy-org/dummy-repo/actions/runs/123456789/deployment_protection_rule"

	e := DeploymentProtectionRuleEvent{
		DeploymentCallbackURL: &url,
	}

	got, _ := e.GetRunID()
	if got != want {
		t.Errorf("want %#v, got %#v", want, got)
	}

	want = 123456789
	url = "repos/dummy-org/dummy-repo/actions/runs/123456789/deployment_protection_rule"

	e = DeploymentProtectionRuleEvent{
		DeploymentCallbackURL: &url,
	}

	got, _ = e.GetRunID()
	if got != want {
		t.Errorf("want %#v, got %#v", want, got)
	}

	want = -1
	url = "https://api.github.com/repos/dummy-org/dummy-repo/actions/runs/abc123/deployment_protection_rule"
	got, err := e.GetRunID()
	if err == nil {
		t.Errorf("Expected error to be returned")
	}

	if got != want {
		t.Errorf("want %#v, got %#v", want, got)
	}
}
Repository: google/go-github
File: github/sub_issue.go (Go)

Code before:
// Copyright 2013 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package github

import (
	"context"
	"fmt"
)

// SubIssueService handles communication with the sub-issue related
// methods of the GitHub API.
//
// Sub-issues help you group and manage your issues with a parent/child relationship.
//
// GitHub API docs: https://docs.github.com/rest/issues/sub-issues
type SubIssueService service

// SubIssue represents a GitHub sub-issue on a repository.
// Note: As far as the GitHub API is concerned, every pull request is an issue,
// but not every issue is a pull request. Some endpoints, events, and webhooks
// may also return pull requests via this struct. If PullRequestLinks is nil,
// this is an issue, and if PullRequestLinks is not nil, this is a pull request.
// The IsPullRequest helper method can be used to check that.

Review comment (security):
```suggestion
// Copyright 2025 The go-github AUTHORS. All rights reserved.
```

Code after:
// Copyright 2025 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package github

import (
	"context"
	"fmt"
)

// SubIssueService handles communication with the sub-issue related
// methods of the GitHub API.
//
// Sub-issues help you group and manage your issues with a parent/child relationship.
//
// GitHub API docs: https://docs.github.com/rest/issues/sub-issues
type SubIssueService service

// SubIssue represents a GitHub sub-issue on a repository.
// Note: As far as the GitHub API is concerned, every pull request is an issue,
// but not every issue is a pull request. Some endpoints, events, and webhooks
// may also return pull requests via this struct. If PullRequestLinks is nil,
// this is an issue, and if PullRequestLinks is not nil, this is a pull request.
// The IsPullRequest helper method can be used to check that.
Repository: google/go-github
File: github/sub_issue.go (Go)

Code before:
//
//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues
func (s *SubIssueService) Add(ctx context.Context, owner string, repo string, issueNumber int, subIssue *SubIssueRequest) (*SubIssue, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/issues/%d/sub_issues", owner, repo, issueNumber)
	req, err := s.client.NewRequest("POST", u, subIssue)
	if err != nil {
		return nil, nil, err
	}

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

	return si, resp, nil
}

// Reprioritize changes a sub-issue's priority to a different position in the parent list.
//
// Either afterId or beforeId must be specified to determine the new position of the sub-issue.
//
// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue
//
//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority
func (s *SubIssueService) Reprioritize(ctx context.Context, owner string, repo string, issueNumber int, subIssue *SubIssueRequest) (*SubIssue, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/issues/%d/sub_issues/priority", owner, repo, issueNumber)
	req, err := s.client.NewRequest("PATCH", u, subIssue)
	if err != nil {
		return nil, nil, err
	}

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

	return si, resp, nil
}


Review comment (suggestion):
```suggestion
func (s *SubIssueService) Reprioritize(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) {
```

Code after:
		return nil, nil, err
	}

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

	return si, resp, nil
}

// Reprioritize changes a sub-issue's priority to a different position in the parent list.
//
// Either afterId or beforeId must be specified to determine the new position of the sub-issue.
//
// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue
//
//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority
func (s *SubIssueService) Reprioritize(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues/priority", owner, repo, issueNumber)
	req, err := s.client.NewRequest("PATCH", u, subIssue)
	if err != nil {
		return nil, nil, err
	}

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

	return si, resp, nil
}
Repository: google/go-github
File: github/sub_issue_test.go (Go)

Code before:
// Copyright 2013 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package github

import (
	"context"
	"encoding/json"
	"fmt"
	"net/http"
	"testing"

	"github.com/google/go-cmp/cmp"
)

func TestSubIssuesService_Add(t *testing.T) {
	t.Parallel()
	client, mux, _ := setup(t)

	input := &SubIssueRequest{SubIssueID: 42}

	mux.HandleFunc("/repos/o/r/issues/1/sub_issues", func(w http.ResponseWriter, r *http.Request) {
		v := new(SubIssueRequest)
		assertNilError(t, json.NewDecoder(r.Body).Decode(v))

Review comment (security):
```suggestion
// Copyright 2025 The go-github AUTHORS. All rights reserved.
```

Code after:
// Copyright 2025 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package github

import (
	"context"
	"encoding/json"
	"fmt"
	"net/http"
	"testing"

	"github.com/google/go-cmp/cmp"
)

func TestSubIssuesService_Add(t *testing.T) {
	t.Parallel()
	client, mux, _ := setup(t)

	input := &SubIssueRequest{SubIssueID: 42}

	mux.HandleFunc("/repos/o/r/issues/1/sub_issues", func(w http.ResponseWriter, r *http.Request) {
		v := new(SubIssueRequest)
		assertNilError(t, json.NewDecoder(r.Body).Decode(v))
Repository: google/go-github
File: github/sub_issue_test.go (Go)

Code before:
			t.Errorf("Request body = %+v, want %+v", v, input)
		}

		fmt.Fprint(w, `{"id":42, "number":1}`)
	})

	ctx := context.Background()
	got, _, err := client.SubIssue.Add(ctx, "o", "r", 1, input)
	if err != nil {
		t.Errorf("SubIssues.Add returned error: %v", err)
	}

	want := &SubIssue{Number: Ptr(1), ID: Int64(42)}
	if !cmp.Equal(got, want) {
		t.Errorf("SubIssues.Add = %+v, want %+v", got, want)
	}
}

func TestSubIssuesService_ListByIssue(t *testing.T) {
	t.Parallel()
	client, mux, _ := setup(t)

	mux.HandleFunc("/repos/o/r/issues/1/sub_issues", func(w http.ResponseWriter, r *http.Request) {
		testMethod(t, r, "GET")
		testHeader(t, r, "Accept", mediaTypeV3)

		fmt.Fprint(w, `[{"id":1},{"id":2}]`)
	})

	ctx := context.Background()
	opt := &IssueListOptions{}
	issues, _, err := client.SubIssue.ListByIssue(ctx, "o", "r", 1, opt)
	if err != nil {
		t.Errorf("SubIssues.ListByIssue returned error: %v", err)
	}

	want := []*SubIssue{{ID: Int64(1)}, {ID: Int64(2)}}
	if !cmp.Equal(issues, want) {
		t.Errorf("SubIssues.ListByIssue = %+v, want %+v", issues, want)
	}
}

func TestSubIssuesService_Remove(t *testing.T) {
	t.Parallel()
	client, mux, _ := setup(t)

	input := &SubIssueRequest{SubIssueID: 42}

	mux.HandleFunc("/repos/o/r/issues/1/sub_issues", func(w http.ResponseWriter, r *http.Request) {
		testHeader(t, r, "Accept", mediaTypeV3)


Review comment (bug):
For all these tests, please add the appropriate test helpers that you will find throughout this repo... e.g. `testBadOptions` and `testNewRequestAndDoFailure`

Code after:
			t.Errorf("Request body = %+v, want %+v", v, input)
		}

		fmt.Fprint(w, `{"id":42, "number":1}`)
	})

	ctx := context.Background()
	got, _, err := client.SubIssue.Add(ctx, "o", "r", 1, *input)
	if err != nil {
		t.Errorf("SubIssues.Add returned error: %v", err)
	}

	want := &SubIssue{Number: Ptr(1), ID: Int64(42)}
	if !cmp.Equal(got, want) {
		t.Errorf("SubIssues.Add = %+v, want %+v", got, want)
	}

	const methodName = "Add"
	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
		got, resp, err := client.SubIssue.Add(ctx, "o", "r", 1, *input)
		if got != nil {
			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
		}
		return resp, err
	})
}

func TestSubIssuesService_ListByIssue(t *testing.T) {
	t.Parallel()
	client, mux, _ := setup(t)

	mux.HandleFunc("/repos/o/r/issues/1/sub_issues", func(w http.ResponseWriter, r *http.Request) {
		testMethod(t, r, "GET")

		fmt.Fprint(w, `[{"id":1},{"id":2}]`)
	})

	ctx := context.Background()
	opt := &IssueListOptions{}
	issues, _, err := client.SubIssue.ListByIssue(ctx, "o", "r", 1, opt)
	if err != nil {
		t.Errorf("SubIssues.ListByIssue returned error: %v", err)
	}

	want := []*SubIssue{{ID: Int64(1)}, {ID: Int64(2)}}
	if !cmp.Equal(issues, want) {
		t.Errorf("SubIssues.ListByIssue = %+v, want %+v", issues, want)
	}

	const methodName = "ListByIssue"
	testBadOptions(t, methodName, func() (err error) {
Repository: google/go-github
File: github/sub_issue.go (Go)

Code before:
//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues
func (s *SubIssueService) Add(ctx context.Context, owner string, repo string, issueNumber int, subIssue *SubIssueRequest) (*SubIssue, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues", owner, repo, issueNumber)
	req, err := s.client.NewRequest("POST", u, subIssue)
	if err != nil {
		return nil, nil, err
	}

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

	return si, resp, nil
}

// Reprioritize changes a sub-issue's priority to a different position in the parent list.
//
// Either afterId or beforeId must be specified to determine the new position of the sub-issue.
//
// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue
//
//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority
func (s *SubIssueService) Reprioritize(ctx context.Context, owner, repo string, issueNumber int64, subIssue *SubIssueRequest) (*SubIssue, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/issues/%d/sub_issues/priority", owner, repo, issueNumber)
	req, err := s.client.NewRequest("PATCH", u, subIssue)
	if err != nil {
		return nil, nil, err
	}

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

	return si, resp, nil
}


Review comment (suggestion):
```suggestion
	u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues/priority", owner, repo, issueNumber)
```

Code after:
	}

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

	return si, resp, nil
}

// Reprioritize changes a sub-issue's priority to a different position in the parent list.
//
// Either afterId or beforeId must be specified to determine the new position of the sub-issue.
//
// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue
//
//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority
func (s *SubIssueService) Reprioritize(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues/priority", owner, repo, issueNumber)
	req, err := s.client.NewRequest("PATCH", u, subIssue)
	if err != nil {
		return nil, nil, err
	}

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

	return si, resp, nil
}
Repository: google/go-github
File: github/sub_issue.go (Go)

Code before:
//
//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues
func (s *SubIssueService) Add(ctx context.Context, owner string, repo string, issueNumber int, subIssue *SubIssueRequest) (*SubIssue, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues", owner, repo, issueNumber)
	req, err := s.client.NewRequest("POST", u, subIssue)
	if err != nil {
		return nil, nil, err
	}

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

	return si, resp, nil
}

// Reprioritize changes a sub-issue's priority to a different position in the parent list.
//
// Either afterId or beforeId must be specified to determine the new position of the sub-issue.
//
// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue
//
//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority
func (s *SubIssueService) Reprioritize(ctx context.Context, owner, repo string, issueNumber int64, subIssue *SubIssueRequest) (*SubIssue, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/issues/%d/sub_issues/priority", owner, repo, issueNumber)
	req, err := s.client.NewRequest("PATCH", u, subIssue)
	if err != nil {
		return nil, nil, err
	}

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

	return si, resp, nil
}


Review comment (suggestion):
```suggestion
func (s *SubIssueService) Reprioritize(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) {
```

Code after:
		return nil, nil, err
	}

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

	return si, resp, nil
}

// Reprioritize changes a sub-issue's priority to a different position in the parent list.
//
// Either afterId or beforeId must be specified to determine the new position of the sub-issue.
//
// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue
//
//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority
func (s *SubIssueService) Reprioritize(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues/priority", owner, repo, issueNumber)
	req, err := s.client.NewRequest("PATCH", u, subIssue)
	if err != nil {
		return nil, nil, err
	}

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

	return si, resp, nil
}