merger

package
v0.0.0-...-3a64406 Latest Latest
Warning

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

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

Documentation

Overview

Package merger contains the Merger object, which incorporates a changelog.Changelog into a full markdown changelog.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Merger

type Merger struct {
	// ReleasedOn is a function that returns the date in which the new section was released. It defaults to time.Now.
	ReleasedOn func() time.Time
	// contains filtered or unexported fields
}

Merger is an object that can incorporate a changelog.Changelog (section) into an existing CHANGELOG.md document.

func New

func New(ch *changelog.Changelog, newVersion *semver.Version) Merger

New creates a Merger that will integrate the supplied changelog.Changelog into a full Markdown document that contains changelogs for older versions. The inserted section will be marked as being the changelog for the version specified in the supplied semver.Version, and also marked as released on the date returned by Merger.ReleasedOn. Merger is an immutable object and does not modify the changelog.Changelog object, nor the original document supplied to Merge.

func (Merger) Merge

func (m Merger) Merge(srcChangelog io.Reader, dst io.Writer) error

Merge uses the configured changelog and version to read the current, full changelog in Markdown format from srcChangelog, and write to dst a new full changelog containing the entries specified in the changelog.Changelog object that was passed to New. The source file is left intact and the changelog.Changelog object supplied to New are not modified.

Jump to

Keyboard shortcuts

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