glob

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadPattern = errors.New("syntax error in pattern")

ErrBadPattern indicates a globbing pattern was malformed.

Functions

func IsGlob

func IsGlob(pattern string) bool

IsGlob returns true when the pattern is a valid glob

func Match

func Match(pattern, str string) (matched bool, err error)

Match returns true when string matches pattern. Returns an error when the pattern is invalid.

Types

type Glob

type Glob struct {
	Pattern string
	Desc    bool
	Limits  []string
	IsGlob  bool
}

Glob structure for simple string matching

func Parse

func Parse(pattern string, desc bool) *Glob

Parse returns a glob structure from the pattern.

Jump to

Keyboard shortcuts

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