Documentation
¶
Index ¶
- func Check() string
- func CheckForUpdate(cacheDir, apiBase, current string) string
- func NoticeChangelog(latest string) string
- func PlatformAssetName() string
- func ReleaseURL(tag string) string
- func Run(out io.Writer, client *http.Client, apiBase, installPath string) error
- func SelfUpgradeCommand() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Check ¶ added in v0.7.160
func Check() string
Check reports the latest release tag if it is newer than the running binary, or "" if there is nothing to report. It is the entry point for the update notice on every surface that shows one, so the opt-out guards live here rather than at each call site. Test runs are covered by CheckForUpdate's "dev" guard: version.Value is only set from main.go, so it is always "dev" under test and nothing is fetched or written.
Callers that need to inject a cache dir or API base — the tests below — should use CheckForUpdate instead.
func CheckForUpdate ¶ added in v0.7.160
CheckForUpdate returns the latest release tag if it is strictly newer than current, or "" if up to date, the check fails, or current is "dev". Results are cached in cacheDir for 24 h to stay within GitHub's unauthenticated rate limit (60 req/hr) even for users running many commands. A cache entry with no version records that the window was used without a usable answer.
func NoticeChangelog ¶ added in v0.7.209
NoticeChangelog returns the short changelog cached for the latest tag, or "" when there is none. It makes no request, so it is safe to call right after Check returns a tag. The tag is checked against the cache because any other chunk process may rewrite it in between, and entries for one release printed under another's heading would be worse than none.
func PlatformAssetName ¶ added in v0.7.48
func PlatformAssetName() string
func ReleaseURL ¶ added in v0.7.188
ReleaseURL returns the GitHub release page for tag, where its changelog lives.
func SelfUpgradeCommand ¶ added in v0.7.160
func SelfUpgradeCommand() string
SelfUpgradeCommand returns the command that upgrades the running binary, accounting for Homebrew installs, which must not be replaced in place.
Types ¶
This section is empty.