Help us shape the future of Go! Take the 2026 Go Developer Survey

sourceignore

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package sourceignore applies project .gitignore files to build inputs and watches. It intentionally reads neither the Git index nor machine-specific exclude files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matcher

type Matcher interface {
	Match(parts []string, directory bool) bool
}

Matcher reports exclusions for paths split into project-relative components. Once a parent directory is excluded, child negations cannot include its files.

func New

func New(lines ...string) Matcher

New creates a matcher from rules relative to the project root.

func Read

func Read(root string) (Matcher, error)

Read loads project rules, with deeper .gitignore files taking precedence. Excluded directories and symbolic links are not traversed.

Jump to

Keyboard shortcuts

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