Help us shape the future of Go! Take the 2026 Go Developer Survey

publishcheck

command
v0.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Command publishcheck is a pure-Go verifier for tools/bench/runner's `-mode publish` JSON output. It exists so publish mode's end-to-end acceptance criteria can be enforced without shelling out to a second-language runtime (closes review finding 06-01:246), and 06-04 reuses this same binary with -emit-rows to generate the published Markdown data rows rather than hand-typing them.

publishcheck unmarshals -file into []internal/bench.Metrics (reusing the shared struct rather than redeclaring the shape, so a renamed or retagged field is caught by the compiler instead of silently going unchecked) and asserts:

  • the file parses as a JSON array;
  • its length equals -want-records;
  • the sorted set of `repo` values equals the sorted -want-repos set;
  • every record's `subject` equals -want-subject;
  • every record's `median_of_trials` equals -want-median-of-trials;
  • every one of files_per_sec, bytes_per_sec, query_latency_median_ms, peak_rss_bytes, cold_start_ms is strictly positive in every record.

Any violation exits non-zero naming the offending record and field. On success it prints one line naming the verified totals plus the SHA-256 of the input file's bytes, so a caller (06-04) can prove byte identity between a stdout capture and a committed artifact without depending on a platform-specific checksum tool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL