Exemplo n.º 1
0
func (this *ArithDivide) Divide(args *entity.ArithRequest, reply *entity.ArithResponse) error {

	if args.GetB() == 0 {
		return errors.New("divide by zero")
	}
	reply.Quo = proto.Int32(args.GetA() / args.GetB())
	reply.Rem = proto.Int32(args.GetA() % args.GetB())
	return nil
}