Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clienterrors: rename WorkerClientError to clienterrors.New #4143

Closed
wants to merge 1 commit into from

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented May 13, 2024

The usual convention to create new object is to prefix New* so this commit renames the WorkerClientError. Initially I thought it would be NewWorkerClientError() but looking at the package prefix it seems unneeded, i.e. clienterrors.New() already provides enough context it seems and it's the only error we construct.

We could consider renaming it to clienterror (singular) too but that could be a followup.

I would also like to make clienterror.Error implement the error interface but that should be a followup to make this (mechanical) rename trivial to review.

Note that the rename was done via

$ go fmt -w 'WorkerClientError -> NewWorkerClientError' ./...

so choosing a different name it "cheap".

Copy link

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jun 13, 2024
@mvo5 mvo5 requested a review from croissanne June 13, 2024 13:55
@mvo5 mvo5 removed the Stale label Jun 13, 2024
croissanne
croissanne previously approved these changes Jun 20, 2024
Copy link
Member

@croissanne croissanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes please!

@croissanne
Copy link
Member

@mvo5 do you mind if I push to your branch with the rebase?

The usual convention to create new object is to prefix `New*` so
this commit renames the `WorkerClientError`. Initially I thought
it would be `NewWorkerClientError()` but looking at the package
prefix it seems unneeded, i.e. `clienterrors.New()` already
provides enough context it seems and it's the only error we
construct.

We could consider renaming it to `clienterror` (singular) too
but that could be a followup.

I would also like to make `clienterror.Error` implement the
`error` interface but that should be a followup to make this
(mechanical) rename trivial to review.
@mvo5
Copy link
Contributor Author

mvo5 commented Jun 21, 2024

@mvo5 do you mind if I push to your branch with the rebase?

Sorry for the slow reply, I rebased and pushed now, sorry that I did not see the conflicts earlier. And thanks for the kind offer to do it for me, that is of course always welcome too :)

@mvo5 mvo5 requested a review from croissanne June 21, 2024 09:14
@mvo5 mvo5 changed the title [RFC] clienterrors: rename WorkerClientError to clienterrors.New clienterrors: rename WorkerClientError to clienterrors.New Jun 21, 2024
Copy link

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jul 22, 2024
Copy link

This PR was closed because it has been stalled for 30+7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants