Skip to content

Commit

Permalink
Request: Use pointer receiver for all functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cdevienne committed Sep 19, 2018
1 parent 978e4fb commit 8f49f70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,13 @@ type Request struct {
}

// Elapsed duration since request was started
func (r Request) Elapsed() time.Duration {
func (r *Request) Elapsed() time.Duration {
return time.Since(r.CreatedAt)
}

// Run the handler and capture any error. Returns the response or the error
// that should be returned to the caller
func (r Request) Run() (msg proto.Message, replyError *Error) {
func (r *Request) Run() (msg proto.Message, replyError *Error) {
r.StartedAt = time.Now()
ctx := r.Context
if r.StreamedReply() {
Expand Down Expand Up @@ -381,7 +381,7 @@ func (r *Request) setupStreamedReply() {
}

// StreamedReply returns true if the request reply is streamed
func (r Request) StreamedReply() bool {
func (r *Request) StreamedReply() bool {
return r.isStreamedReply
}

Expand Down

0 comments on commit 8f49f70

Please sign in to comment.