Skip to content

v0.60.6

Latest

Choose a tag to compare

@github-actions github-actions released this 02 Dec 02:00
Immutable release. Only release title and notes can be modified.
aa8a735

Fixed

  • A JSONL reader that fails in the middle of a line is reported as the failure it is. Open judged the bytes read before the failure as a line, so a pipe closed with an error, a network body that was reset or a gzip stream cut short returned ErrInvalidData ("invalid JSON on line N") and errors.Is(err, cause) was false; the error now wraps the reader's own error under ErrParsing, as CSV, TSV, LTSV and JSON already did. A last line without a trailing newline still loads. (#1235)
  • A TSV reader that fails in the middle of a line is reported as the failure it is. The line scanner hands the bytes after the last newline back as a final line both when the source ends and when it fails, so the partial line reached the column check as a short row, and Open returned ErrColumnMismatch ("row N has 1 fields, want 2") instead of the reader's error. A source that fails is now told apart from one that ends, and its error is returned under ErrParsing before any of the cut line is handed out. A last line without a trailing newline still loads, and BenchmarkOpenTSVReader (100,000 rows from a reader, added with this fix) is unchanged. (#1237)

Changed

  • Tests pin what AddReader callers rely on: a reader that fails part way through returns its own error from Open for every text format, plain, gzip-compressed and cut at every byte of the input; an io.Pipe filled by another goroutine in small writes loads every row across chunks; configuring a builder never fails, and each mistake (no input, a nil reader, a reader without a table name, an unknown FileType, a repeated table name, a missing path) surfaces from Open as the matching sentinel error; an empty TSV field in a text column loads as '', not NULL.
  • New godoc examples show a join on column names that hold spaces, a headerless file given its header with io.MultiReader, and comment lines dropped through an io.Pipe before the data reaches AddReader.
  • Mutation testing runs gomagi instead of gremlins. A pull request still mutates the lines it changes and fails below 90%; the weekly run mutates the whole module in one job and fails below 86%, in place of one job and floor per package.