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

fix old SA1006 lint errors #2695

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

loadtheaccumulator
Copy link
Collaborator

Description

Fixing simple SA1006 lint issues with formatted print statements and no formatting

FIXES:

Type of change

What is it?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation update
  • Tests update
  • Refactor

Signed-off-by: Jonathan Holloway <[email protected]>
@@ -66,7 +65,7 @@ func (t *ThirdPartyRepo) ValidateRequest() error {
return errors.New(RepoNameCantBeInvalidMessage)
}
if !ValidateRepoURL(t.URL) {
return fmt.Errorf(InvalidURL)
return errors.New(InvalidURL)
Copy link
Member

Choose a reason for hiding this comment

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

we could have the Error as a constant directly InvalidURLErr = ..... That way whoever consumes the package can use errors.Is() ... to tell which error was returned (if interested).
Not a big deal, we'd need to refactor all the errors here, which is probably not what we want to do.

Copy link
Member

Choose a reason for hiding this comment

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

Would be a nice follow-up if you'd like :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Definitely. Constants are used elsewhere, so we can always add error refactor to the list.

Copy link
Member

@ezr-ondrej ezr-ondrej left a comment

Choose a reason for hiding this comment

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

Thank you! 👍

@ezr-ondrej ezr-ondrej merged commit 7bd962a into RedHatInsights:main Aug 20, 2024
7 checks passed
@loadtheaccumulator loadtheaccumulator deleted the fix_lint_issues branch August 20, 2024 13:26
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.

2 participants