versioncheck

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 22 Imported by: 1 module, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndNotify

func CheckAndNotify(ctx context.Context, w io.Writer, currentVersion string)

CheckAndNotify performs a version check and notifies the user if a newer version is available. This is the main entry point for the version check system. The function is silent on all errors to avoid interrupting CLI operations.

func UpdateCommandForCurrentBinary added in v0.7.8

func UpdateCommandForCurrentBinary(currentVersion string) string

UpdateCommandForCurrentBinary returns the shell command that updates this binary, based on how it was installed.

The fallback receives the exec path as the OS reports it (not normalized), so the Windows installer hint can name the directory the binary lives in.

Types

type AutoUpdateAction added in v0.6.0

type AutoUpdateAction string

AutoUpdateAction describes the result of an update prompt.

type ChannelManifest added in v0.11.6

type ChannelManifest struct {
	Channel     string `json:"channel"`
	Tag         string `json:"tag"`
	Version     string `json:"version"`
	PublishedAt string `json:"published_at,omitempty"`
}

ChannelManifest is the per-channel pointer file published to the release origin at release time (channels/stable.json, channels/nightly.json). It answers exactly one question — "what is the current version on this channel" — and deliberately carries no checksums: checksums.txt, which GoReleaser generates and mirrors alongside the archives, stays the single integrity source. Two places listing the same hashes is two places that can disagree.

type GitHubRelease

type GitHubRelease struct {
	TagName    string `json:"tag_name"`
	Prerelease bool   `json:"prerelease"`
}

GitHubRelease represents the GitHub API response for a release.

type VersionCache

type VersionCache struct {
	LastCheckTime  time.Time `json:"last_check_time"`
	SkippedVersion string    `json:"skipped_version,omitempty"`
}

VersionCache represents the cached version check data.

Jump to

Keyboard shortcuts

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