HiI want to send a concrete struct type (implements an interface) through RPC. The RPC method, on the other side, receives the interface type.
In node package:type InterfaceName interface {Action() string}type Approach struct {Position int}func (p Approach) Action() string {return "Approach"}func (t *RPCMethod) SomeRPCMethod(command InterfaceName, reply *int) error {// other code}In main package:import "node"// code snippet for sending over rpcgob.Register(node.Approach{}) //register node.Approach{}var p = node.Approach{position}var q node. InterfaceName = pvar reply interr = client.Call("RPCMethod. SomeRPCMethod",&q, &reply)Even after registering node.Approach{} with gob, I am getting the following error message:gob: name not registered for interface: "node.Approach"
Any pointers on how to register name of the interface?Thanks--
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.