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

ellipses

package
v3.8.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidEllipsesFormatFn = func(arg string) error {
	return fmt.Errorf("invalid ellipsis format in (%s), ellipsis range must be provided in format {N...M} where N and M are positive integers, M must be greater than N,  with an allowed minimum range of 4", arg)
}

ErrInvalidEllipsesFormatFn error returned when invalid ellipses format is detected.

View Source
var ErrInvalidListFormatFn = func(arg string) error {
	return fmt.Errorf("invalid list format in (%s)", arg)
}

ErrInvalidListFormatFn error returned when invalid list format is detected.

Functions

func HasEllipses

func HasEllipses(args ...string) bool

HasEllipses - returns true if input arg has ellipses type pattern.

func HasList

func HasList(args ...string) bool

HasList - returns true if input arg has list type pattern {1,3,5}

Types

type ArgPattern

type ArgPattern []Pattern

ArgPattern contains a list of patterns provided in the input.

func FindEllipsesPatterns

func FindEllipsesPatterns(arg string) (ArgPattern, error)

FindEllipsesPatterns - finds all ellipses patterns, recursively and parses the ranges numerically.

func FindListPatterns

func FindListPatterns(arg string) (ArgPattern, error)

FindListPatterns - finds all list patterns, recursively and parses the ranges numerically.

func (ArgPattern) Expand

func (a ArgPattern) Expand() [][]string

Expand - expands all the ellipses patterns in the given argument.

type Pattern

type Pattern struct {
	Prefix string
	Suffix string
	Seq    []string
}

Pattern - ellipses pattern, describes the range and also the associated prefix and suffixes.

func (Pattern) Expand

func (p Pattern) Expand() []string

Expand - expands a ellipses pattern.

Jump to

Keyboard shortcuts

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