Help us shape the future of Go! Take the 2026 Go Developer Survey

update

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package update provides functionality for self-updating the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Updater

type Updater struct {
	// contains filtered or unexported fields
}

Updater handles the self-update process.

func NewUpdater

func NewUpdater(httpClient *http.Client) *Updater

NewUpdater creates a new Updater.

func (*Updater) CheckForUpdate

func (u *Updater) CheckForUpdate(ctx context.Context, owner, repo, currentVersion string) (*github.RepositoryRelease, bool, error)

CheckForUpdate checks for a new release on GitHub.

func (*Updater) UpdateTo

func (u *Updater) UpdateTo(fs afero.Fs, executablePath string, release *github.RepositoryRelease, assetName, checksumsAssetName string) error

UpdateTo downloads the new release, verifies its checksum, and replaces the current executable.

Jump to

Keyboard shortcuts

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