- Notifications
You must be signed in to change notification settings - Fork126
Tags: keybase/go-keychain
Tags
v0.0.1
secretservice: replace pkg/errors for Go stdlib errors, and fix unhan……dled error (#111)* secretservice: fix SecretService.PromptAndWait discarding errorThis code was always returning a nil error instead of the error producedby the org.freedesktop.Secret.Prompt.Prompt call.Signed-off-by: Sebastiaan van Stijn <github@gone.nl>* secretservice: SecretService.openSessionRaw explicitly handle errorpkg/errors' errors.Wrap function implicitly discards nil-errors. Whilethis is convenient, it also can be err-prone, as this behavior differsfrom go stdlib, making it easy to miss conditions where the reader assumesan error is returned (but in reality no error).This patch updates the code to explicitly handle non-nil errors to preventaccidental regressions if this code would be rewritten using go stdlib.Signed-off-by: Sebastiaan van Stijn <github@gone.nl>* secretservice: rename var that shadowed typeSigned-off-by: Sebastiaan van Stijn <github@gone.nl>* secretservice: fix GoDoc commentSigned-off-by: Sebastiaan van Stijn <github@gone.nl>* secretservice: replace pkg/errors for Go stdlib errorsThe pkg/errors dependency was introduced with the secretservice implementationin7f2ef9f in March 2019.go1.13 (September 2019) introduced native support for unwrapping errors, nolonger requiring this dependency to be used, and the pkg/errors module hasbeen archived (as feature complete).While pkg/errors does have some advantages (for example, it can provide astack 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 equivalentin Go stdlib.Signed-off-by: Sebastiaan van Stijn <github@gone.nl>---------Signed-off-by: Sebastiaan van Stijn <github@gone.nl>