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

Allows multiple measurements #6

Merged
merged 3 commits into from
Oct 2, 2024
Merged

Allows multiple measurements #6

merged 3 commits into from
Oct 2, 2024

Conversation

Ruteri
Copy link
Collaborator

@Ruteri Ruteri commented Sep 27, 2024

No description provided.

for _, v := range validators {
if !v.OID().Equal(validators[0].OID()) {
// This is not an error! This is a bug!
panic("validators with mismatching OIDs passed in!")
Copy link
Contributor

Choose a reason for hiding this comment

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

Would returning an err be better here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I strongly prefer to panic in this case -- this is not an user error.

Copy link
Contributor

Choose a reason for hiding this comment

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

it's fine with me in this case :)

curious why tho. shouldn't generally libraries or imported code never panic but always return an error, because that allows the application to decide what to show and how to handle?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah there's something to what you are saying.
In this specific scenario this is more a part of the application rather than a library

@fnerdman
Copy link
Collaborator

LGTM

@Ruteri Ruteri marked this pull request as ready for review October 2, 2024 11:56
@Ruteri Ruteri merged commit e3325b4 into main Oct 2, 2024
@Ruteri Ruteri deleted the multi-validator branch October 2, 2024 12:37
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.

3 participants