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

Check the type assertion on funk.Keys return value. #1256

Merged
merged 1 commit into from
Jan 8, 2020
Merged

Conversation

porridge
Copy link
Member

@porridge porridge commented Jan 8, 2020

What this PR does / why we need it:

Make lint happy again.
This was result of a race between merging #1223 and #1245

Copy link
Member

@ANeumann82 ANeumann82 left a comment

Choose a reason for hiding this comment

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

Thanks. I ran into this already

Copy link
Member

@nfnt nfnt left a comment

Choose a reason for hiding this comment

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

LGTM!

planNames := funk.Keys(pf.Operator.Plans).([]string)
planNames, ok := funk.Keys(pf.Operator.Plans).([]string)
if !ok {
panic("funk.Keys returned unexpected type")
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't panic: for the most part we os.Exit(1) with some log message before. It gives us the chance to introduce different exit codes more smoothly later. Otherwise, LGTM

@porridge
Copy link
Member Author

porridge commented Jan 8, 2020

Merging early to keep master green. Keeping the panic here since that's equivalent to what would happen on the unchecked type assertion.

@porridge porridge merged commit 6dcbee3 into master Jan 8, 2020
@porridge porridge deleted the fix-typeassert branch January 8, 2020 15:09
ANeumann82 pushed a commit that referenced this pull request Feb 13, 2020
Make lint happy again.
This was result of a race between merging #1223 and #1245

Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
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

5 participants