versionfile

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package versionfile writes a release's version into the files a language's own tooling reads it from, for a language whose version is not the tag (spec 0027 D2). Each format is an adapter behind Writer; colophon itself stays language-neutral.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnwritable = errors.New("cannot write the version into a version file")

ErrUnwritable reports a version file the adapter could not read precisely enough to rewrite. A release whose files disagree with its tag is worse than none, so this stops the proposal.

Functions

This section is empty.

Types

type Release

type Release struct {
	// Next maps each releasing directory to its next version. "" is the root.
	Next map[string]string

	// Own lists every directory on a version line of its own, releasing or
	// not, so a writer can tell an independent version from a mistake.
	Own []string
}

Release says which versions a release moves to.

func (Release) LineOf

func (r Release) LineOf(dir string) string

LineOf names the version line a directory is on: the own directory that contains it, or "" for the root's.

type Writer

type Writer interface {
	Write(fsys fs.FS, manifest string, release Release) ([]tree.File, error)
}

Writer moves a release's versions into one format's files, starting from the manifest it is named with, and returns only the files it changed.

Directories

Path Synopsis
Package cargo writes a release's version into a Cargo crate or workspace: the package or workspace version, the requirements that name a member by path, and Cargo.lock (spec 0027 D3).
Package cargo writes a release's version into a Cargo crate or workspace: the package or workspace version, the requirements that name a member by path, and Cargo.lock (spec 0027 D3).

Jump to

Keyboard shortcuts

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