update

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package update implements the self-update flow: checking the public releases repo for a newer version and swapping the running binary in place.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareVersions

func CompareVersions(a, b string) int

CompareVersions returns positive when a is newer than b, negative when older, zero when equal. Pre-releases (1.24.0-rc1) sort below their release (1.24.0); non-semver strings (dev builds: "", "dev") sort below every release.

func MarkSkipped

func MarkSkipped(version string)

MarkSkipped records that the user declined the given version.

Types

type Release

type Release struct {
	Version string // without the leading "v"
	Asset   string // asset download URL for this platform
}

Release describes a newer version available for install.

func Check

func Check(current string) (*Release, error)

Check forces a check ignoring the daily cache (used by /update), while still honoring QMAX_NO_UPDATE_CHECK and dev builds.

func MaybeCheck

func MaybeCheck(current string) *Release

MaybeCheck returns a Release when a newer version exists and the user should be asked about it now (respecting the daily cache, the skip marker, dev builds, and QMAX_NO_UPDATE_CHECK). Network failures return nil — the check must never break startup.

func (*Release) Apply

func (r *Release) Apply(exePath string) error

Apply downloads the release and atomically replaces the binary at exePath. The running process is unaffected; a restart picks up the new version.

func (*Release) Download

func (r *Release) Download() ([]byte, error)

Download fetches the release archive and returns its bytes.

Jump to

Keyboard shortcuts

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