func (t *Arith) Div(args *message.ArithRequest, reply *message.ArithResponse) error { if args.GetB() == 0 { return errors.New("divide by zero") } reply.C = args.GetA() / args.GetB() return nil }
func (t *Arith) Mul(args *message.ArithRequest, reply *message.ArithResponse) error { reply.C = args.GetA() * args.GetB() return nil }
func (t *Arith) Mul(args *message.ArithRequest, reply *message.ArithResponse) error { reply.C = args.A * args.B return nil }
func (t *Arith) Add(args *message.ArithRequest, reply *message.ArithResponse) error { reply.C = args.GetA() + args.GetB() log.Infof("Arith.Add(%v, %v): %v", args.GetA(), args.GetB(), reply.GetC()) return nil }
func (t *Arith) Add(args *message.ArithRequest, reply *message.ArithResponse) error { reply.C = args.A + args.B log.Infof("Arith.Add(%v, %v): %v", args.A, args.B, reply.C) return nil }