-
Notifications
You must be signed in to change notification settings - Fork 68
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
Go: Implement Bitfield and Bitfield ReadOnly commands #2999
base: main
Are you sure you want to change the base?
Go: Implement Bitfield and Bitfield ReadOnly commands #2999
Conversation
Signed-off-by: Niharika Bhavaraju <[email protected]>
Signed-off-by: Niharika Bhavaraju <[email protected]>
Signed-off-by: Niharika Bhavaraju <[email protected]>
Signed-off-by: Niharika Bhavaraju <[email protected]>
} | ||
|
||
// Subcommands for bitfieldReadOnly. | ||
type BitFieldROCommands interface { |
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.
Why are 2 separate interfaces required?
Can we have only one interface named BitFieldCommands
?
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.
Hi @prateek-kumar-improving ,
There are 2 interfaces because one of the interfaces contains dummy()
The dummy() method in BitFieldROCommands helps to distinguish read-only operations from write operations. I followed the convention which is at please refer ZRange as mentioned by @Yury-Fridlyand here
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 allows us to implement for BitFieldGet
struct two interfaces: BitFieldROCommands
and BitFieldCommands
and use it into 2 commands. Having that trick don't duplicate code and don't allow using BitFieldSet
in BitFieldRO
} | ||
|
||
// Subcommands for bitfieldReadOnly. | ||
type BitFieldROCommands interface { |
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 allows us to implement for BitFieldGet
struct two interfaces: BitFieldROCommands
and BitFieldCommands
and use it into 2 commands. Having that trick don't duplicate code and don't allow using BitFieldSet
in BitFieldRO
Signed-off-by: Niharika Bhavaraju <[email protected]>
Go: Implement Bitfield and Bitfield ReadOnly commands