From dcc1efa2bd402c0d68f9b9d6aed9ebea0f782917 Mon Sep 17 00:00:00 2001 From: Michael Hoffman Date: Sun, 2 Feb 2025 20:22:16 -0500 Subject: [PATCH] clean up --- pkg/cmd/repo/autolink/create/http.go | 4 ---- pkg/cmd/repo/autolink/delete/delete_test.go | 2 +- pkg/cmd/repo/autolink/view/http.go | 2 +- pkg/cmd/repo/autolink/view/http_test.go | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pkg/cmd/repo/autolink/create/http.go b/pkg/cmd/repo/autolink/create/http.go index d7ee940b9..5f187319f 100644 --- a/pkg/cmd/repo/autolink/create/http.go +++ b/pkg/cmd/repo/autolink/create/http.go @@ -45,10 +45,6 @@ func (a *AutolinkCreator) Create(repo ghrepo.Interface, request AutolinkCreateRe defer resp.Body.Close() - // if resp.StatusCode != http.StatusCreated { - // return nil, api.HandleHTTPError(resp) - // } - err = handleAutolinkCreateError(resp) if err != nil { diff --git a/pkg/cmd/repo/autolink/delete/delete_test.go b/pkg/cmd/repo/autolink/delete/delete_test.go index 99233fb1e..6dee277f8 100644 --- a/pkg/cmd/repo/autolink/delete/delete_test.go +++ b/pkg/cmd/repo/autolink/delete/delete_test.go @@ -133,7 +133,7 @@ func TestDeleteRun(t *testing.T) { return nil } }, - wantStdout: "Autolink 123 has key prefix TICKET-.✓ Autolink 123 deleted from OWNER/REPO\n", + wantStdout: "Autolink 123 has key prefix TICKET-.✓Autolink 123 deleted from OWNER/REPO\n", }, { name: "delete with confirm flag", diff --git a/pkg/cmd/repo/autolink/view/http.go b/pkg/cmd/repo/autolink/view/http.go index 8dd6dc12d..cc5638613 100644 --- a/pkg/cmd/repo/autolink/view/http.go +++ b/pkg/cmd/repo/autolink/view/http.go @@ -30,7 +30,7 @@ func (a *AutolinkViewer) View(repo ghrepo.Interface, id string) (*shared.Autolin defer resp.Body.Close() if resp.StatusCode == http.StatusNotFound { - return nil, fmt.Errorf("HTTP 404: Either no autolink with this ID exists for this repository or you are missing admin rights to the repository. (https://api.github.com/%s)", path) + return nil, fmt.Errorf("HTTP 404: Perhaps you are missing admin rights to the repository? (https://api.github.com/%s)", path) } else if resp.StatusCode > 299 { return nil, api.HandleHTTPError(resp) } diff --git a/pkg/cmd/repo/autolink/view/http_test.go b/pkg/cmd/repo/autolink/view/http_test.go index c47418404..b792c9750 100644 --- a/pkg/cmd/repo/autolink/view/http_test.go +++ b/pkg/cmd/repo/autolink/view/http_test.go @@ -69,7 +69,7 @@ func TestAutolinkViewer_View(t *testing.T) { "status": "404" }`, expectErr: true, - expectedErrMsg: "HTTP 404: Either no autolink with this ID exists for this repository or you are missing admin rights to the repository. (https://api.github.com/repos/OWNER/REPO/autolinks/123)", + expectedErrMsg: "HTTP 404: Perhaps you are missing admin rights to the repository? (https://api.github.com/repos/OWNER/REPO/autolinks/123)", }, }