changelog

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package changelog parses the repo's release-please-maintained CHANGELOG.md into the entries GET /api/v1/changelog and the dashboard's "What's new" panel serve, so release notes keep exactly one source of truth instead of a second, hand-curated copy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFile

func ReadFile(candidates ...string) (content string, found bool, err error)

ReadFile returns the contents of the first existing path in candidates (empty strings are skipped), with found=false and no error when none exist: a missing CHANGELOG.md is a normal, non-fatal state for a bare binary install that hasn't shipped one yet, not an error.

Types

type Entry

type Entry struct {
	Version string
	Date    string
	Bullets []string
}

Entry is one released version's notes.

func Latest

func Latest(entries []Entry, n int) []Entry

Latest returns at most n entries from the front of entries, which are already newest-first (CHANGELOG.md's own order). n <= 0 returns every entry.

func Parse

func Parse(markdown string) []Entry

Parse reads CHANGELOG.md's "## version (date)" headings and the "* bullet" / "- bullet" lines under each one, across every "### Section" subheading, into a flat, newest-first Bullets list. Any other "## " heading (for example a hand-written "Unreleased" preamble sometimes left at the file's tail) resets the current entry so its bullets are never misattributed to the previous release.

Jump to

Keyboard shortcuts

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