Documentation
¶
Overview ¶
Package update implements self-update for the kyc-cli binary.
Design (per user/security review):
- Explicit `kyc-cli update` subcommand. Never auto-update silently.
- On startup, optionally print a one-line nudge if a newer release is available and the user hasn't been told within the last 24h.
- Refuse to overwrite the binary if it's owned by a package manager (Homebrew Cellar, Scoop, apt, etc.) — those users get told to use their package manager instead.
- Verify the downloaded archive's sha256 against the release's checksums.txt before swapping.
No external Go deps — everything here is std lib + sha256 + tar.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckLatest ¶
CheckLatest resolves the latest non-draft, non-prerelease release tag via the HTML redirect endpoint (no API rate limit). Returns ("", nil) if `current` is already up to date.
func CheckLatestThrottled ¶
CheckLatestThrottled is CheckLatest with a 24h-on-disk cache so we only hit the GH API at most once per day per machine. Returns "" if either (a) no newer version, (b) we hit the cache and skipped, or (c) the network call failed (don't pester users on flaky networks).
func DoUpdate ¶
DoUpdate downloads the matching tarball/zip for `tag`, verifies sha256 against checksums.txt, and atomically replaces the running binary. Returns nil on success.
func PackageManagerOrigin ¶
func PackageManagerOrigin() string
PackageManagerOrigin returns a non-empty string when the running binary appears to live under a package manager's tree, signalling "tell the user to run brew/scoop/apt instead of self-update".
Types ¶
This section is empty.