Documentation
¶
Overview ¶
Package update checks whether a newer release of tickli is available and upgrades the binary in place by re-running `go install`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartCheck ¶
StartCheck launches an update check in the background and returns a function that prints a one-line notice to w when a newer version is available.
The check runs concurrently with the caller's work (which is typically blocked on network I/O of its own), so it adds no perceptible latency. The returned function waits at most printGrace for the check to finish.
Types ¶
type VersionStatus ¶ added in v0.0.15
type VersionStatus int
VersionStatus reports how the running version compares to the latest release.
const ( // StatusUnknown means the comparison could not be made: a dev build, the // check is disabled, or the latest version could not be determined. StatusUnknown VersionStatus = iota // StatusUpToDate means the running version is the latest release. StatusUpToDate // StatusOutdated means a newer release is available. StatusOutdated )
func CheckVersion ¶ added in v0.0.15
func CheckVersion(current string) (status VersionStatus, latest string)
CheckVersion compares current against the latest published release. It reuses the on-disk cache the background notifier primes and only hits the network when that cache is missing or stale. latest holds the newest known version when status is StatusUpToDate or StatusOutdated.