-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
secretservice: replace pkg/errors for Go stdlib errors, and fix unhan…
…dled error (#111) * secretservice: fix SecretService.PromptAndWait discarding error This code was always returning a nil error instead of the error produced by the org.freedesktop.Secret.Prompt.Prompt call. Signed-off-by: Sebastiaan van Stijn <[email protected]> * secretservice: SecretService.openSessionRaw explicitly handle error pkg/errors' errors.Wrap function implicitly discards nil-errors. While this is convenient, it also can be err-prone, as this behavior differs from go stdlib, making it easy to miss conditions where the reader assumes an error is returned (but in reality no error). This patch updates the code to explicitly handle non-nil errors to prevent accidental regressions if this code would be rewritten using go stdlib. Signed-off-by: Sebastiaan van Stijn <[email protected]> * secretservice: rename var that shadowed type Signed-off-by: Sebastiaan van Stijn <[email protected]> * secretservice: fix GoDoc comment Signed-off-by: Sebastiaan van Stijn <[email protected]> * secretservice: replace pkg/errors for Go stdlib errors The pkg/errors dependency was introduced with the secretservice implementation in 7f2ef9f in March 2019. go1.13 (September 2019) introduced native support for unwrapping errors, no longer requiring this dependency to be used, and the pkg/errors module has been archived (as feature complete). While pkg/errors does have some advantages (for example, it can provide a stack trace), this functionality doesn't appear to be used in this module, and the pkg/errors package is not used in other implementations (for macOS). This patch removes the dependency, replacing its use for the equivalent in Go stdlib. Signed-off-by: Sebastiaan van Stijn <[email protected]> --------- Signed-off-by: Sebastiaan van Stijn <[email protected]>
- Loading branch information
Showing
4 changed files
with
31 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters