-
Notifications
You must be signed in to change notification settings - Fork 66
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
incorrect interface #33
incorrect interface #33
Comments
I think panics being an intentional design decision in an interface is not a good choice, and isn't something I'd personally want to support. If you'd like to work with that interface instead, I think it's better to write a shim that wraps the |
Indeed, it does not. I don't think it should, either, because the semantics don't match. |
(*Flock).Lock and (*Flock).Unlock return errors, unlike the Lock and Unlock methods specified by sync.Locker. Therefore, don't mention sync.Locker in package-level documentation, to avoid confusion. Fixes #33.
Either way seems fine to me. There are way more things that may panic with filelocks, so I get the aversion to panics. Simply fixing the Readme removes confusion as well. Will close since I don't think much can be said, more of a sematics problem. |
Either way seems fine to me. There are way more things that may panic with filelocks, so I get the aversion to panics. Simply fixing the Readme removes confusion as well. |
full diff: gofrs/flock@v0.7.0...v0.7.1 - gofrs/flock#34 don't mention sync.Locker in package documentation - fixes gofrs/flock#33 incorrect interface - gofrs/flock#35 Fix linting issues and add goreportcard badge Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: gofrs/flock@v0.7.0...v0.7.1 - gofrs/flock#34 don't mention sync.Locker in package documentation - fixes gofrs/flock#33 incorrect interface - gofrs/flock#35 Fix linting issues and add goreportcard badge Signed-off-by: Sebastiaan van Stijn <[email protected]> Upstream-commit: 61a2b7ac94bdd7be69e71af08e26bc2a8bd7e675 Component: engine
full diff: gofrs/flock@v0.7.0...v0.7.1 - gofrs/flock#34 don't mention sync.Locker in package documentation - fixes gofrs/flock#33 incorrect interface - gofrs/flock#35 Fix linting issues and add goreportcard badge Signed-off-by: Sebastiaan van Stijn <[email protected]> Signed-off-by: zach <[email protected]>
full diff: gofrs/flock@v0.7.0...v0.7.1 - gofrs/flock#34 don't mention sync.Locker in package documentation - fixes gofrs/flock#33 incorrect interface - gofrs/flock#35 Fix linting issues and add goreportcard badge Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: gofrs/flock@v0.7.0...v0.7.1 - gofrs/flock#34 don't mention sync.Locker in package documentation - fixes gofrs/flock#33 incorrect interface - gofrs/flock#35 Fix linting issues and add goreportcard badge Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: gofrs/flock@v0.7.0...v0.7.1 - gofrs/flock#34 don't mention sync.Locker in package documentation - fixes gofrs/flock#33 incorrect interface - gofrs/flock#35 Fix linting issues and add goreportcard badge Signed-off-by: Sebastiaan van Stijn <[email protected]> Upstream-commit: ad4ca6f0d03115098a61e3fce86173f5bdf2ac6e Component: cli
Flock does not exactly follow the sync.Locker interface, as it's Lock() method returns an error. sync.Mutex panics in certain occasions. I think we could have a version of flock which also panics instead of returning errors, to ensure we have the correct interface.
The text was updated successfully, but these errors were encountered: