We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Since we already have sync.Locker interface, it would be pretty nice to have sync.RWLocker interface with two additional methods:
sync.Locker
sync.RWLocker
package sync struct RWLocker interface { Locker RLock() RUnlock() }
I suggest it will be widely disseminated for the purposes of mocking (e.g. mocking structs with embedded mocks).
The text was updated successfully, but these errors were encountered:
I assume this is just for convenience - you could define this interface outside of the standard library and it would work just as fine.
Sorry, something went wrong.
The only reason that the sync package has Locker is because https://golang.org/pkg/sync/#NewCond takes a Locker.
We don't proactively add interfaces for things users might want.
If you need an interface, you can define it yourself, as @mvdan says. That's one of the nice things about implicitly implementing interfaces.
No branches or pull requests
Since we already have
sync.Locker
interface, it would be pretty nice to havesync.RWLocker
interface with two additional methods:I suggest it will be widely disseminated for the purposes of mocking (e.g. mocking structs with embedded mocks).
The text was updated successfully, but these errors were encountered: