-
Notifications
You must be signed in to change notification settings - Fork 31
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
Implement --proto-descriptor-file #195
Implement --proto-descriptor-file #195
Conversation
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.
Thank you for filing this PR! I left some minor comments, but overall LGTM.
main.go
Outdated
var protoDescriptorFileContent []byte | ||
if opts.ProtoDescriptorFile != "" { | ||
var err error | ||
b, err := os.ReadFile(opts.ProtoDescriptorFile) |
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.
I think we don't need to use temporal variable b
here as err
is defined above.
protoDescriptorFileContent, err = os.ReadFile(opts.ProtoDescriptorFile)
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.
Thank you!
Fixed in 30e2eab
session.go
Outdated
directedRead *pb.DirectedReadOptions | ||
tc *transactionContext | ||
tcMutex sync.Mutex // Guard a critical section for transaction. | ||
protoDescriptorFileContent []byte |
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.
nit: maybe we can use more concise variable name like protoDescriptor
because the session doesn't care if the proto descriptor was coming from file content or not.
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.
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.
LGTM.
This PR implements
--proto-descriptor-file
option withUSE
statement compatibility.fixes #174