Loading pkg/rpcexamplelib/server.go +2 −10 Original line number Diff line number Diff line Loading @@ -2,21 +2,13 @@ package rpcexamplelib import "errors" type Args struct { A, B int } type Quotient struct { Quo, Rem int } type Arith int // Multiply is an rpc multiplication. func (t *Arith) Multiply(args *Args, reply *int) error { *reply = args.A * args.B return nil } // Divide provides a rpc division resulting in a quotient and reminder. func (t *Arith) Divide(args *Args, quo *Quotient) error { if args.B == 0 { return errors.New("divide by zero") Loading pkg/rpcexamplelib/types.go 0 → 100644 +14 −0 Original line number Diff line number Diff line package rpcexamplelib // Args is a wrapper for calling rpcs type Args struct { A, B int } // Quotient is the result of Divide type Quotient struct { Quo, Rem int } // Arith is the interface type type Arith int Loading
pkg/rpcexamplelib/server.go +2 −10 Original line number Diff line number Diff line Loading @@ -2,21 +2,13 @@ package rpcexamplelib import "errors" type Args struct { A, B int } type Quotient struct { Quo, Rem int } type Arith int // Multiply is an rpc multiplication. func (t *Arith) Multiply(args *Args, reply *int) error { *reply = args.A * args.B return nil } // Divide provides a rpc division resulting in a quotient and reminder. func (t *Arith) Divide(args *Args, quo *Quotient) error { if args.B == 0 { return errors.New("divide by zero") Loading
pkg/rpcexamplelib/types.go 0 → 100644 +14 −0 Original line number Diff line number Diff line package rpcexamplelib // Args is a wrapper for calling rpcs type Args struct { A, B int } // Quotient is the result of Divide type Quotient struct { Quo, Rem int } // Arith is the interface type type Arith int