internal

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT, BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalIndexes

func CanonicalIndexes(indexes []int) []int

CanonicalIndexes returns nil when indexes is simply 0, 1, 2, and so on, as a dense array should leave the indexes nil.

func DeleteIndexedElem

func DeleteIndexedElem(list []string, indexes []int, k int) ([]string, []int)

DeleteIndexedElem is like SetIndexedElem, but unsetting the element at index k, which may leave a hole.

func ExtendedPatternMatcher

func ExtendedPatternMatcher(pat string, mode pattern.Mode) (func(string) bool, error)

ExtendedPatternMatcher returns a regexp.Regexp.MatchString-like function to support !(pattern-list) extended patterns where possible. It can be used instead of pattern.Regexp for narrow use cases.

func IndexedMax

func IndexedMax(list []string, indexes []int) int

IndexedMax returns the maximum index of an indexed array, or -1 when the array is empty.

func SetIndexedElem

func SetIndexedElem(list []string, indexes []int, k int, val string) ([]string, []int)

SetIndexedElem returns list and indexes with the element at index k set, converting a dense array to a sparse one when setting index k would otherwise leave a hole. The index k must not be negative.

func TestMainSetup

func TestMainSetup()

TestMainSetup is used by the integration tests running shell scripts either via our interpreter or via real shells, to ensure a reasonably clean and consistent environment.

Types

This section is empty.

Jump to

Keyboard shortcuts

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