update

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package update checks GitHub Releases for a newer orchard and can replace the running binary in place. The version check is a single unauthenticated GET, cached for a day, opt out with ORCHARD_NO_UPDATE_CHECK.

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyLatest = errors.New("already on the latest version")

ErrAlreadyLatest is returned by Apply when the running version is current.

Functions

func Apply

func Apply(ctx context.Context, current string) (string, error)

Apply downloads the latest release for this OS/arch, verifies its checksum, and replaces the running binary. It refuses (with guidance) for go-install and Homebrew builds, which have their own update path.

func Check

func Check(ctx context.Context, current string) (tag string, available bool)

Check returns the latest tag and whether it is newer than current, using a 24h on-disk cache. Honors ORCHARD_NO_UPDATE_CHECK. Network errors are soft.

func Current

func Current(ldflag string) string

Current resolves the running version: the ldflag-injected version if present, else the module version recorded by `go install` (build info), else "dev".

func Newer

func Newer(current, latest string) bool

Newer reports whether latest is a strictly higher MAJOR.MINOR.PATCH than current. Returns false when current is not a clean version (e.g. "dev"), so development builds are never nagged.

Types

This section is empty.

Jump to

Keyboard shortcuts

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