Documentation ¶
Overview ¶
Package replacecr defines a wrapper for replacing solo carriage return characters (\r) with carriage-return + line feed (\r\n). Copied from https://github.com/qri-io/starlib/tree/master/util/replacecr
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Reader ¶
Reader wraps an io.Reader. on every call of Read. it looks for for instances of lonely \r replacing them with \r\n before returning to the end consumer lots of files in the wild will come without "proper" line breaks, which irritates go's standard csv package. This'll fix by wrapping the reader passed to csv.NewReader:
rdr, err := csv.NewReader(replacecr.Reader(r))
because Reader adds '\n' characters, the number of bytes reported from the underlying reader can/will differ from what the underlyng reader would return if read from directly. This can cause issues with checksums and byte counts. Use with caution.
Types ¶
This section is empty.