tidy

package
v0.15.21 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 6 Imported by: 1 module, 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 tidy takes out of a package definition what a release can be read for.

A definition is written once, by the conversion or by a person, and read by every generation after that. What it should say is the part a release can't answer -- which assets are the command, which of its files is the executable, who signs it -- because everything else is read off the release each time and a definition repeating it is a copy that can go out of date without anybody touching it.

The definitions written before that was true still say the rest, so this takes it out.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Removed added in v0.0.39

type Removed struct {
	// Spellings are the replacements that went, as "<platform>: <spelling>".
	Spellings []string
	// Checksums is how many checksum blocks went.
	Checksums int
	// Overrides is how many overrides went for saying nothing.
	Overrides int
	// VariantAssets is how many variants' assets went for saying their libc in the name.
	VariantAssets int
}

Removed is what a tidying took out of a definition.

func Definition added in v0.0.39

func Definition(content string) (string, *Removed, error)

Definition takes out of a definition what it doesn't have to say: the spellings the parser works out for itself, where the checksum file is, and an override left saying nothing but which environment it is for. It says what went.

The file is edited as a syntax tree rather than read into a definition and written back out. A package's definition is a file a maintainer edits: the comment saying why a filter is there is the most valuable line in it, and re-rendering would drop it while claiming to have tidied up.

Every replacements block is reached, wherever it is: the definition's own, each version_override's, and each override's within them. A block left with nothing goes altogether rather than staying as an empty map.

func (*Removed) Any added in v0.0.39

func (r *Removed) Any() bool

Any reports whether anything went.

Jump to

Keyboard shortcuts

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