self

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package self implements the self commands: reporting what this binary is, and replacing it with a newer release.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUpdateDevelopmentBuild = errors.New("cannot self-update a development build; install a tagged release first")
	ErrUpdateBrewBuild        = errors.New("gotpm was installed via Homebrew; update with: brew upgrade gotpm")
)

Functions

func Update

func Update(info BuildInfo, opts *Options) error

Update replaces this binary with the latest release from GitHub.

func Version

func Version(info BuildInfo)

Version prints what this binary is.

Types

type BuildInfo

type BuildInfo struct {
	Version   string
	Commit    string
	OS        string
	Arch      string
	Installer string
}

BuildInfo describes the running binary. It is filled from the values stamped into the cmd package at build time.

func (BuildInfo) IsDevelopment

func (b BuildInfo) IsDevelopment() bool

IsDevelopment reports whether this binary was built without a release tag.

type Options

type Options struct {
	// CheckOnly looks for an update without installing it.
	CheckOnly bool
}

Options holds the resolved self-update flags.

Jump to

Keyboard shortcuts

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