From c3b98881b0b4cce42dc977ba8e8159752348a9c2 Mon Sep 17 00:00:00 2001 From: Martin Sucha Date: Fri, 4 Mar 2022 13:32:32 +0100 Subject: [PATCH] Document that Parse/ParseND is for objects/arrays Related: https://github.com/minio/simdjson-go/issues/59 --- simdjson_amd64.go | 4 ++-- simdjson_other.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/simdjson_amd64.go b/simdjson_amd64.go index 91b02ad..4838a9f 100644 --- a/simdjson_amd64.go +++ b/simdjson_amd64.go @@ -59,7 +59,7 @@ func newInternalParsedJson(reuse *ParsedJson, opts []ParserOption) (*internalPar return pj, nil } -// Parse a block of data and return the parsed JSON. +// Parse an object or array from a block of data and return the parsed JSON. // An optional block of previously parsed json can be supplied to reduce allocations. func Parse(b []byte, reuse *ParsedJson, opts ...ParserOption) (*ParsedJson, error) { pj, err := newInternalParsedJson(reuse, opts) @@ -75,7 +75,7 @@ func Parse(b []byte, reuse *ParsedJson, opts ...ParserOption) (*ParsedJson, erro return parsed, nil } -// ParseND will parse newline delimited JSON. +// ParseND will parse newline delimited JSON objects or arrays. // An optional block of previously parsed json can be supplied to reduce allocations. func ParseND(b []byte, reuse *ParsedJson, opts ...ParserOption) (*ParsedJson, error) { pj, err := newInternalParsedJson(reuse, opts) diff --git a/simdjson_other.go b/simdjson_other.go index 531a9a9..5d76c48 100644 --- a/simdjson_other.go +++ b/simdjson_other.go @@ -30,13 +30,13 @@ func SupportedCPU() bool { return false } -// Parse a block of data and return the parsed JSON. +// Parse an object or array from a block of data and return the parsed JSON. // An optional block of previously parsed json can be supplied to reduce allocations. func Parse(b []byte, reuse *ParsedJson, opts ...ParserOption) (*ParsedJson, error) { return nil, errors.New("Unsupported platform") } -// ParseND will parse newline delimited JSON. +// ParseND will parse newline delimited JSON objects or arrays. // An optional block of previously parsed json can be supplied to reduce allocations. func ParseND(b []byte, reuse *ParsedJson, opts ...ParserOption) (*ParsedJson, error) { return nil, errors.New("Unsupported platform")