update

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 24 Imported by: 0 modules, 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

Overview

Package update finds ccswap's newest release on GitHub and installs it over a ccswap binary.

Index

Constants

This section is empty.

Variables

View Source
var API = "https://api.github.com"

API is GitHub's REST API, a test seam.

Functions

func Install

func Install(ctx context.Context, rel Release, bin string) error

Install puts rel's build for this platform at bin. The archive must match the release's checksums.txt and its binary must run and report rel's version before one rename replaces bin, so a running ccswap keeps its old file and nothing ever runs half a binary.

func Known

func Known(v string) bool

Known reports whether v names a version that releases can be compared with.

func Newer

func Newer(release, current string) bool

Newer reports whether release is later than current; never when either is not a version.

func UserAgent

func UserAgent(version string) string

UserAgent is what ccswap calls itself in its requests to GitHub and Anthropic.

Types

type Release

type Release struct {
	Version string // its tag, such as v0.2.0
	URL     string // its page
	// contains filtered or unexported fields
}

Release is a published ccswap release.

func Latest

func Latest(ctx context.Context, userAgent string) (Release, error)

Latest asks GitHub for the newest release; drafts and prereleases are never the latest.

Jump to

Keyboard shortcuts

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