예제 #1
0
파일: all_test.go 프로젝트: jwk000/protorpc
func (t *Arith) Div(args *msg.ArithRequest, reply *msg.ArithResponse) error {
	if args.GetB() == 0 {
		return errors.New("divide by zero")
	}
	reply.C = proto.Int32(args.GetA() / args.GetB())
	return nil
}
예제 #2
0
파일: all_test.go 프로젝트: jwk000/protorpc
func (t *Arith) Mul(args *msg.ArithRequest, reply *msg.ArithResponse) error {
	reply.C = proto.Int32(args.GetA() * args.GetB())
	return nil
}