Documentation
¶
Overview ¶
Package updatecheck queries GitHub for the latest bones release tag and emits a one-line stderr notice when the running binary is behind. Best-effort and rate-limited (once per 24h cached on disk). Called from cmd/bones/main.go at process start.
Design notes:
- The notice is printed synchronously from the on-disk cache. The network refresh runs asynchronously and may not finish before a short-lived CLI process exits — that's OK; the next long- enough invocation picks up the new latest.
- "dev" builds (no version embedded) skip the check entirely so local hacking never triggers a network call.
- Suppressed by env var BONES_UPDATE_CHECK=0.
- All errors are silent: an update check that fails must never interfere with the verb the user actually ran.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CacheTTL = 24 * time.Hour
CacheTTL is the minimum interval between network refreshes. Exported for tests; production callers leave it at 24h.
var FetchTimeout = 3 * time.Second
FetchTimeout caps how long the async refresh waits for GitHub.
var LatestReleaseURL = "https://api.github.com/repos/danmestas/bones/releases/latest"
LatestReleaseURL is the GitHub API endpoint queried for the latest release tag. Exported so tests can override it without monkey-patching.
var UpgradeHint = "brew upgrade danmestas/tap/bones"
UpgradeHint is the user-facing instruction appended to every notice. One-line so the notice fits on a single stderr row.
Functions ¶
Types ¶
This section is empty.