Implement in Go 1.22 or newer using only the standard library. The application root is a Go module, and its executable is the main package at `./cmd/csvstat`. Tests run under `go test`. The harness runs `go build -o ./cmd/csvstat` and then runs 22 checks. The file is **rejected** when it is empty, when a header name is empty or repeated, or when any record has a different number of fields from the header. Every header name and every value is trimmed of leading and trailing spaces before any other rule applies. A column's type is the first of these that every non-null value satisfies: Header `column,type,rows,nulls,distinct,min,max,sum,mean,median`, then one row per column in file order (or the one named by `--column`). CSV on standard output with `\n` line endings. Header `value,count`, then one row per distinct non-null value of the column, ordered by count descending, then value ascending by byte value, at most `--top` rows. `--top ` | With `--freq`, list at most `` values. A positive integer; default `5`. A failing command writes nothing to standard output and one diagnostic line to standard error naming the file and, for a rejected record, its line number. The completed application provides a POSIX-compatible `bin/test.sh` that runs `go vet ./...` and `go test ./...` from the application root and exits zero only when both pass.