selfupdate

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package selfupdate performs a best-effort check for a newer released disbug CLI and formats an upgrade nudge. It never blocks or fails a command: any error, missing network, or unparseable version simply yields no notice.

Index

Constants

View Source
const CheckInterval = 24 * time.Hour

CheckInterval bounds how often the network is consulted for the latest release.

Variables

This section is empty.

Functions

func GitHubLatest

func GitHubLatest(ctx context.Context) (string, error)

GitHubLatest returns the latest disbug release tag from GitHub. It is the default FetchFunc used by Notice in released builds. The timeout is short and all errors are returned to the caller, which treats them as "no notice".

func Notice

func Notice(ctx context.Context, current, dir string, now time.Time, fetch FetchFunc) string

Notice returns an upgrade message when a released version newer than current exists. It returns an empty string when current is up to date, when current is not a released semantic version (for example a "dev" build), or when the check cannot complete. The result is safe to ignore.

Types

type FetchFunc

type FetchFunc func(context.Context) (string, error)

FetchFunc returns the latest released version tag, for example "v0.3.0".

Jump to

Keyboard shortcuts

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