1
0
mirror of https://github.com/golang/go synced 2024-11-24 06:10:05 -07:00

rpc: fix bug that caused private methods to attempt to be registered.

Fixes #1056.

R=golang-dev, adg1
CC=golang-dev
https://golang.org/cl/2033043
This commit is contained in:
Rob Pike 2010-08-30 08:03:06 +10:00
parent 089ce17093
commit 64cb9b6f45

View File

@ -211,7 +211,7 @@ func (server *serverType) register(rcvr interface{}) os.Error {
method := s.typ.Method(m)
mtype := method.Type
mname := method.Name
if mtype.PkgPath() != "" && !isPublic(mname) {
if mtype.PkgPath() != "" || !isPublic(mname) {
continue
}
// Method needs three ins: receiver, *args, *reply.