update

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package update provides a passive, best-effort version check that runs on every CLI invocation. It caches the latest known GitHub release so the check adds zero latency on the critical path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CachePath

func CachePath() string

CachePath returns the path to the update-check cache file. Falls back to a relative path when the home directory cannot be resolved.

func CachedLatestVersion

func CachedLatestVersion(cachePath string) string

CachedLatestVersion returns the latest version from the on-disk cache. Returns "" when the cache is absent, corrupt, or older than 48 hours.

func CheckAndRefresh

func CheckAndRefresh(cachePath string)

CheckAndRefresh fetches the latest release from GitHub and writes it to cachePath when the existing cache is older than 24 hours. Errors are silently discarded — the update check is best-effort.

func InstallHint

func InstallHint() string

InstallHint returns a human-readable upgrade command appropriate for the installation method inferred from the executable path. Falls back to the GitHub releases URL when detection is inconclusive.

func IsNewer

func IsNewer(currentVersion, latestVersion string) bool

IsNewer reports whether latestVersion is strictly greater than currentVersion using semver comparison. Returns false for dev builds, empty strings, or inputs that cannot be parsed as valid semver.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL