--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
The ID is shoehorned into the request header, so there isn't any additional RPC.
The tricky part is not necessarily transporting the ID, but storing it somewhere useful, since there's no thread/goroutine local storage, which is what's used in C++/Java IIRC. Storing it in the exported object seems like a neat trick, that way it can be accessed without polluting the method's arguments and it's local to the goroutine. AFAICT the method object isn't used for anything, it only exits to allow reflection of exported methods, their arguments and return value.
I suspect you could even avoid manually passing on the ID - if the object implemented a Call method it could do remote RPC calls and forward on the ID found in the object. Adding a Call method may complicate things though (is it an exported method that can be called remotely, or not). Either way, I don't think it's impossible to solve with this "store it in the exported object" technique.