gitignore

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package gitignore builds project gitignore files from selected templates in GitHub's official github/gitignore collection.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrOutputExists indicates that Generate would overwrite a file without force.
	ErrOutputExists = errors.New("output file already exists")
	// ErrTemplateNotFound indicates that GitHub does not have the requested template.
	ErrTemplateNotFound = errors.New("gitignore template not found")
)

Functions

func Build

func Build(ctx context.Context, templates string) (string, error)

Build returns gitignore content assembled from the requested templates.

func Generate

func Generate(ctx context.Context, templates, output string, force bool) error

Generate builds a gitignore from templates and writes it to output.

Types

type TemplateDefinition

type TemplateDefinition struct {
	Name    string
	Aliases []string
}

TemplateDefinition describes an available template and its accepted names.

func Templates

func Templates() []TemplateDefinition

Templates returns the available templates and their accepted aliases.

Jump to

Keyboard shortcuts

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