I have a package store as follows.
package store
type dbClient struct {
client rpc.Client
}
func init() {
// init dbClient
}
type Args struct{}
type Reply struct{
Stories []interface{}
}
func GetStories() ([]interface{}, error) {
args := Args{}
var reply Reply
err := dbClient.client.Call("Database.GetStories", &Args, &reply)
return reply.Stories, err
}
There are two issues i am facing with this:
The simplest solution is to use the method which is made with your use case in mind: https://golang.org/pkg/net/rpc/#Client.Go