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

errors replacements are labeled as faster #38

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mmorel-35
Copy link
Contributor

No description provided.

analyzer/analyzer.go Outdated Show resolved Hide resolved
@mmorel-35 mmorel-35 changed the title chore: define newFasterFunctionReplacementDiagnostic and newFunctionReplacementDiagnostic chore: define newFasterFunctionReplacementDiagnostic Nov 24, 2024
@catenacyber
Copy link
Owner

Needs a rebase now

@mmorel-35
Copy link
Contributor Author

@catenacyber ,
That's ready to go :) !

Comment on lines +32 to +40
fmt.Sprintf("%s", errSentinel) // want "fmt.Sprintf can be replaced with faster errSentinel.Error()"
fmt.Sprintf("%v", errSentinel) // want "fmt.Sprintf can be replaced with faster errSentinel.Error()"
fmt.Sprint(errSentinel) // want "fmt.Sprint can be replaced with faster errSentinel.Error()"
fmt.Sprintf("%s", io.EOF) // want "fmt.Sprintf can be replaced with faster io.EOF.Error()"
fmt.Sprintf("%v", io.EOF) // want "fmt.Sprintf can be replaced with faster io.EOF.Error()"
fmt.Sprint(io.EOF) // want "fmt.Sprint can be replaced with faster io.EOF.Error()"
fmt.Sprintf("%s", err) // want "fmt.Sprintf can be replaced with faster err.Error()"
fmt.Sprintf("%v", err) // want "fmt.Sprintf can be replaced with faster err.Error()"
fmt.Sprint(err) // want "fmt.Sprint can be replaced with faster err.Error()"
Copy link
Contributor

Choose a reason for hiding this comment

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

Changing the report message constitutes a breaking change. However, the PR's title states "chore: define newFasterFunctionReplacementDiagnostic," which suggests it's a simple refactoring. I propose we either change the PR's title or avoid making breaking changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's related to this #38 (comment)

@mmorel-35 mmorel-35 changed the title chore: define newFasterFunctionReplacementDiagnostic errros.New is now labelled as faster replacement Nov 28, 2024
@mmorel-35 mmorel-35 changed the title errros.New is now labelled as faster replacement errrors replacements are labelled as faster Nov 28, 2024
@mmorel-35 mmorel-35 changed the title errrors replacements are labelled as faster errors replacements are labeled as faster Nov 29, 2024
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.

4 participants