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: Remove always nil return value #778

Merged
merged 1 commit into from
May 24, 2022

Conversation

erezrokah
Copy link
Member

@erezrokah erezrokah commented May 24, 2022

🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉

Summary

New linter caught this. I'm doing this in a separate PR to make verifying the change easier


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 --new-from-rev main 🚨 (install golangci-lint here)
  • Update or add tests 🧪
  • Ensure the status checks below are successful ✅

@erezrokah erezrokah requested a review from a team as a code owner May 24, 2022 16:30
@erezrokah erezrokah requested review from zagronitay and removed request for a team May 24, 2022 16:30
@@ -175,7 +175,6 @@ func (p *Parser) interpret(cfg *BaseConfig) hcl.Diagnostics {
}
}
}
return nil
Copy link
Member Author

@erezrokah erezrokah May 24, 2022

Choose a reason for hiding this comment

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

Return value is always nil and will actually cause a panic in callers I believe

Copy link
Member

Choose a reason for hiding this comment

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

hcl.Diagnostics is a slice:

type Diagnostics []*Diagnostic

nil slice is valid and diags.HasErrors won't cause panic.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

@erezrokah erezrokah May 24, 2022

Choose a reason for hiding this comment

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

Cool, thanks for the context. Should we still remove the return value? It's not used

Copy link
Member

Choose a reason for hiding this comment

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

Sure.

@erezrokah erezrokah added the automerge Automatically merge once required checks pass label May 24, 2022
@kodiakhq kodiakhq bot merged commit dca8745 into cloudquery:main May 24, 2022
@erezrokah erezrokah deleted the fix/always_nil branch May 24, 2022 18:17
TinLe pushed a commit to TinLe/cloudquery that referenced this pull request May 27, 2022
* upstream/main: (22 commits)
  fix: Skip reattached provider update checks (cloudquery#801)
  fix: Add Git Binary To Docker
  chore(main): Release v0.24.1 (cloudquery#780)
  fix: Test flakiness (cloudquery#790)
  feat: Store Policy Output (cloudquery#709)
  fix: Panic in loadPolicyFromSource (cloudquery#787)
  fix: Panic in OsFs.downloadFile (cloudquery#789)
  fix: Error classifier improvements (cloudquery#788)
  fix: Console log log level (cloudquery#786)
  refactor: Use pointer for connection receiver (cloudquery#782)
  fix(deps): Update module github.com/cloudquery/cq-provider-sdk to v0.10.2 (cloudquery#784)
  refactor: Use copy instead of loop (cloudquery#781)
  fix: Remove always nil return value (cloudquery#778)
  test(fetch): Fix assertions to match new test provider (cloudquery#777)
  test(fetch): Pin test provider version (cloudquery#776)
  chore(main): Release v0.24.0 (cloudquery#749)
  fix: Upgrade protocol version to V5 (cloudquery#774)
  fix: Check policy version on it's core version (cloudquery#773)
  fix: Policy output file name (cloudquery#770)
  fix: Policy executor (cloudquery#769)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge once required checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants