-
Notifications
You must be signed in to change notification settings - Fork 3
fix #64 adds settable check functions for cert/serverCert #65
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 #64 adds settable check functions for cert/serverCert #65
Conversation
@@ -76,9 +76,15 @@ type Identity interface { | |||
// StopWatchingFiles reversed WatchFiles. | |||
StopWatchingFiles() | |||
|
|||
// IsCertSettable returns nil if the "cert" certificate storage supports writing, used before calling SetCert() | |||
IsCertSettable() error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo, it seems strange for an 'Is' function to return error not a bool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a go thing because errors are returned, not raised.
Consider this set of outcomes: for (bool,error)
function return values:
1: true, <nil>
2: false, err
3: false, <nil>
It forces the caller to inspect two values instead of 1. By returning error only, they only have to inspect 1. Additionally, nothing stops the code from returning true, error
and in which case, what does that mean?
Returning just bool
doesn't allow error propagation for other issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:D if you say so. I'd just prefer the "Is" to be "Verify" or "Check" or literally anything that isn't "Is" but i don't care all that much
- workflows updated to ref go.mod for go version and update modules used - go 1.23 selected as it is the minimum version currently supported w/o compat issues with the SDK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some linter errors, but otherwise looks good
Done to support openziti/ziti#2984