Skip to content

Commit

Permalink
Add NewResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamSLevy committed Dec 3, 2018
1 parent e39b204 commit b1a6364
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions response.go
Expand Up @@ -20,6 +20,11 @@ type Response struct {
ID interface{} `json:"id"`
}

// NewResponse returns a Response with the given result as the Response.Result.
func NewResponse(result interface{}) Response {
return Response{Result: result}
}

// response hides the json.Marshaler interface that Response implements.
// Response.MarshalJSON uses this type to avoid infinite recursion.
type response Response
Expand Down

0 comments on commit b1a6364

Please sign in to comment.