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

Use efficientgo/core/errors consistently #134

Merged
merged 1 commit into from Dec 2, 2022

Conversation

saswatamcode
Copy link
Member

This PR ensures that we use efficientgo/core/errors consistently, and adds lint rules for the same.

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
@@ -100,7 +101,7 @@ func (a *kAggregate) Next(ctx context.Context) ([]model.StepVector, error) {
a.paramOp.GetPool().PutVectors(args)

if len(args) != len(in) {
return nil, fmt.Errorf("scalar argument not found")
return nil, errors.New("scalar argument not found")
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the advantage of using errors.New instead of fmt.Errorf?

Copy link
Member Author

Choose a reason for hiding this comment

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

This lib has stacktraces + some other advantages in API over Go stdlib one. It was implemented in Thanos first and later ported to efficientgo/core. For more details: thanos-io/thanos#5176 and thanos-io/thanos#5239

Copy link
Member Author

Choose a reason for hiding this comment

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

Also effort on Thanos to port entire codebase to it: thanos-io/thanos#5382 (although now we might do it from efficientgo/core

@fpetkovski fpetkovski merged commit fa5e576 into thanos-io:main Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants