mirror of
https://github.com/golang/go
synced 2024-11-12 05:40:22 -07:00
net/rpc: document that the type must be exported, not just the methods
Fixes #10379. Change-Id: Ia4cdda36ed57a06371f9ace7365ce9e215228487 Reviewed-on: https://go-review.googlesource.com/8654 Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
3b1d0d0f07
commit
514eb4aa54
@ -13,6 +13,7 @@
|
|||||||
Only methods that satisfy these criteria will be made available for remote access;
|
Only methods that satisfy these criteria will be made available for remote access;
|
||||||
other methods will be ignored:
|
other methods will be ignored:
|
||||||
|
|
||||||
|
- the method's type is exported.
|
||||||
- the method is exported.
|
- the method is exported.
|
||||||
- the method has two arguments, both exported (or builtin) types.
|
- the method has two arguments, both exported (or builtin) types.
|
||||||
- the method's second argument is a pointer.
|
- the method's second argument is a pointer.
|
||||||
@ -216,7 +217,7 @@ func isExportedOrBuiltinType(t reflect.Type) bool {
|
|||||||
|
|
||||||
// Register publishes in the server the set of methods of the
|
// Register publishes in the server the set of methods of the
|
||||||
// receiver value that satisfy the following conditions:
|
// receiver value that satisfy the following conditions:
|
||||||
// - exported method
|
// - exported method of exported type
|
||||||
// - two arguments, both of exported type
|
// - two arguments, both of exported type
|
||||||
// - the second argument is a pointer
|
// - the second argument is a pointer
|
||||||
// - one return value, of type error
|
// - one return value, of type error
|
||||||
|
Loading…
Reference in New Issue
Block a user