changelog

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HeadingFor

func HeadingFor(ct ChangeType) string

HeadingFor returns a display label for each ChangeType.

Types

type Change

type Change struct {
	Type ChangeType `toml:"type"`
	Text string     `toml:"text"`
}

Change is a single line item in a version entry.

func SortedChanges

func SortedChanges(e Entry) []Change

SortedChanges returns changes for an entry in canonical category order.

type ChangeType

type ChangeType string

ChangeType classifies a single changelog entry.

const (
	Added      ChangeType = "added"
	Changed    ChangeType = "changed"
	Fixed      ChangeType = "fixed"
	Removed    ChangeType = "removed"
	Deprecated ChangeType = "deprecated"
	Security   ChangeType = "security"
)

type Entry

type Entry struct {
	Version string   `toml:"version"`
	Date    string   `toml:"date"`
	Changes []Change `toml:"changes"`
}

Entry is one version block in the changelog.

func Check

func Check(lastSeen, current string, entries []Entry) (shouldWrite bool, toShow []Entry)

Check returns (shouldWrite, toShow) given last-seen and current version strings and the full set of changelog entries.

Rules:

  • lastSeen == "" (first run) -> shouldWrite=true, toShow=nil
  • Any semver parse failure -> shouldWrite=true, toShow=nil (silent write)
  • current > lastSeen -> shouldWrite=false, toShow=entries in (lastSeen, current] (most recent first)
  • current <= lastSeen -> shouldWrite=false, toShow=nil

func Entries

func Entries() []Entry

Entries returns the parsed changelog entries, or nil on any error.

Jump to

Keyboard shortcuts

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