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

chore: remove all panics #898

Closed
wants to merge 5 commits into from
Closed

chore: remove all panics #898

wants to merge 5 commits into from

Conversation

jptosso
Copy link
Member

@jptosso jptosso commented Oct 31, 2023

Just for precaution

@jptosso jptosso requested a review from a team as a code owner October 31, 2023 09:34
@codecov
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Files Coverage Δ
internal/collections/named.go 91.30% <0.00%> (-2.73%) ⬇️

📢 Thoughts on this report? Let us know!.

@@ -95,11 +95,13 @@ type NamedCollectionNames struct {
}

func (c *NamedCollectionNames) FindRegex(key *regexp.Regexp) []types.MatchData {
panic("selection operator not supported")
// not supported
return []types.MatchData{}
Copy link
Member

Choose a reason for hiding this comment

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

Not sure about this one. The panic feels like a programming error cc @anuraaga

Copy link
Member

Choose a reason for hiding this comment

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

@anuraaga Can you comment on this one? 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah generally we would use panics for programming errors, unimplemented methods of an interface should never be called

@jptosso jptosso closed this Mar 15, 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