Skip to content

Document the command in the package comment - #68

Merged
korya merged 2 commits into
masterfrom
korya-docs-package-doc
Aug 8, 2026
Merged

Document the command in the package comment#68
korya merged 2 commits into
masterfrom
korya-docs-package-doc

Conversation

@korya

@korya korya commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Problem

pkg.go.dev says there is no documentation for this package, and the README links to that page with a badge.

Measured against the currently-indexed v0.0.7, the page renders exactly one thing:

"There is no documentation for this package": True

main.go opened with a bare package main, and pkg.go.dev renders a command's doc comment or nothing at all. So the Go Reference badge on line 1 of the README has been advertising documentation that does not exist.

Solution

Write the package comment, and make the README agree with it about exit codes.

The comment covers the four things somebody arriving from that badge is trying to learn: what the tool is for, the shape of an invocation, the exit codes, and which options read the environment. Every example in it was run against a live endpoint before being written down, and each documented exit code was reproduced:

$ http-assert --log-level nope --assert-ok https://example.com   # exit=71
$ http-assert -X 'BAD METHOD' --assert-ok https://example.com    # exit=91
$ http-assert --assert-ok                                        # exit=103

Writing those down exposed that the README listed three of the five. 71 has been returned since unparseable environment values started being rejected, and 91 for as long as a malformed method or URL has been possible — neither was ever documented. That gap is worse than a missing table row: a monitoring script that reads every non-zero code as "the service is down" reports a typo in HTTP_ASSERT_MAX_TIME as an outage, which inverts the tool's purpose.

Documentation only — no behaviour change, and the end-to-end suite is untouched.

Other Changes

None.

Notes for the reviewer

This lands on the next tag, not retroactively on v0.1.0; pkg.go.dev renders whatever the tagged commit contained.

The exit codes now appear in three places — the package comment, the README, and e2e_harness_test.go's constants. Only the last is enforced. Worth an issue if the duplication bothers you; I did not want to invent a doc-linting mechanism inside a docs PR.

🤖 Generated with Claude Code

korya and others added 2 commits August 7, 2026 21:36
pkg.go.dev showed "There is no documentation for this package" for every
version published so far, because main carried no doc comment. The README
links to that page with a Go Reference badge, so the badge advertised
documentation that did not exist.

Covers what the tool is for, the shape of an invocation, the exit codes, and
which options read the environment -- the four things somebody landing on
pkg.go.dev from the badge is trying to find out.

The exit codes are the part worth writing down. They are the tool's actual
output, and the distinction between a failed assertion and a tool that could
not run is what lets a pipeline tell a broken service from a broken
invocation.

Documentation only; no behaviour change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019EMMhgmTkbzAsmeNy97PrP
Two of the five codes were missing. 71 has been returned since unparseable
environment values started being rejected, and 91 for as long as a malformed
method or URL has been possible -- neither was ever written down.

The gap mattered more than a missing table row. A script that treats every
non-zero code as "the service is down" reads a typo in HTTP_ASSERT_MAX_TIME
as an outage, which is the opposite of what the tool is for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019EMMhgmTkbzAsmeNy97PrP
@korya
korya marked this pull request as ready for review August 8, 2026 01:38
@korya
korya merged commit 928694d into master Aug 8, 2026
1 check passed
@korya
korya deleted the korya-docs-package-doc branch August 8, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant