Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

fix: Remove dead code #419

Merged
merged 2 commits into from
Jul 13, 2022
Merged

fix: Remove dead code #419

merged 2 commits into from
Jul 13, 2022

Conversation

shimonp21
Copy link
Contributor

Summary

The code inside the defaultErrorClassifier was never actually executed, because it was always passed a 'diag', but the first line in defaultErrorClassifier was "if err type is diag, return nil".

In any case, it's definitely better not to classify a single error twice. A more reasonable implementation might be to 'fall back to default classifier, if specific classifier returned nil', but for now, let's just remove it.


Use the following steps to ensure your PR is ready to be reviewed

  • Read the contribution guidelines 🧑‍🎓
  • Run go fmt to format your code 🖊
  • Lint your changes via golangci-lint run 🚨 (install golangci-lint here)
  • Update or add tests 🧪
  • Ensure the status checks below are successful ✅

@shimonp21 shimonp21 requested a review from a team as a code owner July 13, 2022 08:56
@shimonp21 shimonp21 requested review from yevgenypats and roneli and removed request for a team July 13, 2022 08:56
Copy link
Contributor

@roneli roneli left a comment

Choose a reason for hiding this comment

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

LGTM

The code inside the defaultErrorClassifier was never actually executed, because it was always passed a 'diag', but the first line in defaultErrorClassifier was "if err type is diag, return nil".

In any case, it's definitely better not to classify a single error twice. A more reasonable implementation might be to 'fall back to default classifier, if specific classifier returned nil', but for now, let's just remove it.
@shimonp21 shimonp21 merged commit 204eaf9 into cloudquery:main Jul 13, 2022
@shimonp21 shimonp21 deleted the removedeadcode333 branch July 13, 2022 09:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants