jroimartin commented on code in PR #1700:
URL: https://github.com/apache/tinkerpop/pull/1700#discussion_r898489406
##########
gremlin-go/driver/request.go:
##########
@@ -83,6 +88,85 @@ func makeBytecodeRequest(bytecodeGremlin *Bytecode,
traversalSource string, sess
}
}
+// allowedReqArgs contains the arguments that will be extracted from the
+// bytecode and sent with the request.
+var allowedReqArgs = map[string]bool{
+ "evaluationTimeout": true,
+ "scriptEvaluationTimeout": true,
+ "batchSize": true,
+ "requestId": true,
+ "userAgent": true,
+}
+
+// extractReqArgs extracts request arguments from the provided bytecode.
+func extractReqArgs(bytecode *Bytecode) map[string]interface{} {
+ args := make(map[string]interface{})
+
+ for _, insn := range bytecode.sourceInstructions {
Review Comment:
Thanks for the review!
Do you mean using `insn` instead of `instruction` or `sourceInstruction`?
I usually try to stick to the following criteria described by Russ Cox:
> Descriptive names are fine for things that merit description at every
mention.
>
> Receiver names typically don’t, nor do names scoped to a small amount of
code (like a small loop body or even a small function).
(Reference: https://twitter.com/_rsc/status/1507319374612414472)
Also, I didn't want to shadow the `instruction` type.
That being said, I'm more than happy to change it if that fits better with
the coding style of the project. What do you suggest?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]