YAML supports a document terminator (...) when reading files in a
stream. This allows for the reader to indicate that the current document
has ended without indicating that the stream is finished. Anything after
the document terminator is ignored by the consumer. Therefore, we write
the terminator at the end of a read file, then immediately follow with a
YAML document separator (---), which is mandatory according to the YAML
spec when using document terminators.
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
The FsReadCloser claimed to implictly skip empty files, but this was
only true when the final file to be read was empty. This updates to add
a SkipEmpty option that will filter out empty files before even
attempting to read file contents.
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Adds the annotate method to FsReadCloser so that it can provide
additional context to parser about most recently read data in the event
of an error.
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Adds note to NewFsReadCloser to indicate that symbolic links will not be
honored when walking the filesystem.
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Implements io.ReadCloser for afero.Fs to allow passing it to a parser
that accepts an io.ReadCloser and reads from it.
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>