Skip to content

Commit

Permalink
Clean up ParseRequests documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
creachadair committed Sep 12, 2021
1 parent da0026c commit 419b34b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions base.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,10 @@ func (r *Request) ParamString() string { return string(r.params) }
var ErrInvalidVersion = Errorf(code.InvalidRequest, "incorrect version marker")

// ParseRequests parses a single request or a batch of requests from JSON.
// The parsed parameters are either nil or have concrete type json.RawMessage.
//
// If any of the requests is missing or has an invalid JSON-RPC version, it
// returns ErrInvalidVersion along with the parsed results. Otherwise, no
// validation apart from basic structure is performed on the results.
// If msg is syntactically valid apart from one or more of the requests having
// a missing or invalid JSON-RPC version, ParseRequests returns ErrInvalidVersion
// along with the parsed results.
func ParseRequests(msg []byte) ([]*Request, error) {
var req jmessages
if err := req.parseJSON(msg); err != nil {
Expand Down

0 comments on commit 419b34b

Please sign in to comment.