]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1] net/rpc: fix typo in documentation, clarify semantics of error...
authorDavid G. Andersen <dave.andersen@gmail.com>
Fri, 21 Sep 2012 19:53:44 +0000 (05:53 +1000)
committerRob Pike <r@golang.org>
Fri, 21 Sep 2012 19:53:44 +0000 (05:53 +1000)
««« backport ef713d7587f2
net/rpc: fix typo in documentation, clarify semantics of error return

Several of my students were confused by trying to use both the error
return and a reply return, so I figured it was worth explicitly clarifying
that returning an error overrides the reply.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6327051

»»»

src/pkg/net/rpc/server.go

index 1680e2f0d7086ed445ffc3374896d35917b37afe..9e0aa0ce2066d0079df6abe827729c6969bae083 100644 (file)
 
        where T, T1 and T2 can be marshaled by encoding/gob.
        These requirements apply even if a different codec is used.
-       (In future, these requirements may soften for custom codecs.)
+       (In the future, these requirements may soften for custom codecs.)
 
        The method's first argument represents the arguments provided by the caller; the
        second argument represents the result parameters to be returned to the caller.
        The method's return value, if non-nil, is passed back as a string that the client
-       sees as if created by errors.New.
+       sees as if created by errors.New.  If an error is returned, the reply parameter
+       will not be sent back to the client.
 
        The server may handle requests on a single connection by calling ServeConn.  More
        typically it will create a network listener and call Accept or, for an HTTP