Skip to content
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

net/rpc: type names for arg and reply might not not need to be exported #3163

Closed
robpike opened this issue Mar 1, 2012 · 3 comments
Closed

Comments

@robpike
Copy link
Contributor

robpike commented Mar 1, 2012

This variant of the server in net/rpc/server_test.go works fine:

type args struct {
    A, B int
}

type reply struct {
    C int
}

type arith struct {
    Nothing int
}

func (t *arith) Add(args args, reply *reply) error {
    reply.C = args.A + args.B
    return nil
}


if we use RegisterName("Arith", new(arith)) and disable the export checks in
server.go.  Since those checks are there for early identification of problematic
methods, it makes sense to relax this restriction. However, it can't be done before Go 1
because methods might become RPC-able that are not currently, and that's an unwise
change to make at this point.
@rsc
Copy link
Contributor

rsc commented Mar 12, 2013

Comment 1:

[The time for maybe has passed.]

@chai2010
Copy link
Contributor

Comment 2:

Does some one planing to fix this issue?
If no, I can submit a patch.

@rsc
Copy link
Contributor

rsc commented Jun 26, 2013

Comment 3:

It probably shouldn't be done after Go 1 either, for the same reason. Probably best to
just leave things alone.

Status changed to WorkingAsIntended.

@robpike robpike self-assigned this Jun 26, 2013
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc unassigned robpike Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants