package
0.0.0-20250312152250-ea85ec9d2454
Repository: https://github.com/snapcore/snapd.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
Package shlex implements a simple lexer which splits input in to tokens using shell-style rules for quoting and commenting.

# Functions

CommaSeparatedList takes a comma-separated series of identifiers, and returns a slice of the space-trimmed identifiers, without empty entries.
Deduplicate returns a newly allocated slice with the same contents as the input, excluding duplicates.
ElliptLeft returns a string that is at most n runes long, replacing the first rune with an ellipsis if necessary.
ElliptRight returns a string that is at most n runes long, replacing the last rune with an ellipsis if necessary.
Entropy returns a heuristic value of the passed string entropy in bits.
No description provided by the author
Intersection computes the intersection of a set of slices, treating each slice as a set.
IntsToCommaSeparated converts an int array to a comma-separated string without whitespace.
JoinErrors returns an error that wraps the given errors.
JoinNonEmpty concatenates non-empty strings using sep as separator, and trimming sep from beginning and end of the strings.
ListContains determines whether the given string is contained in the given list of strings.
MultiCommaSeparatedList parses each string in strs with CommaSeparatedList and returns the concatenation of all parsed values.
No description provided by the author
NewOrderedMap creates a new ordered map initialized with the given pairs of strings.
NewPathIterator returns an iterator for traversing the given path.
ParseByteSize parses a value like 500kB and returns the number in bytes.
Quoted formats a slice of strings to a quoted list of comma-separated strings, e.g.
SizeToStr converts the given size in bytes to a readable string.
SortedListContains determines whether the given string is contained in the given list of strings, which must be sorted.
SortedListsUniqueMerge merges the two given sorted lists of strings, repeated values will appear once in the result.
SplitUnit takes a string of the form "123unit" and splits it into the number and non-number parts (123,"unit").
TruncateOutput truncates input data by maxLines, imposing maxBytes limit (total) for them.
VersionCompare compare two version strings that follow the debian version policy and Returns: -1 if a is smaller than b 0 if a equals b +1 if a is bigger than b.
WordWrap wraps the given text to the given width, prefixing the first line with indent and the remaining lines with indent2.
WordWrapPadded wraps the given text, assumed to be part of a block-style yaml string, to fit into termWidth, preserving the line's indent, and writes it out prepending padding to each line.

# Variables

using golang.org/x/text/unicode/rangetable do rangetable.Merge(unicode.Co, unicode.Cf, unicode.Cs, unicode.Noncharacter_Code_Point) (we also care about unicode.Cc but that's handled by hand) this makes the lookup in escape quite a bit faster (over 5×).

# Structs

No description provided by the author
A MatchCounter is a discarding io.Writer that retains up to N matches to its Regexp before just counting matches.
OrderedMap is a map of strings to strings that preserves the insert order when calling "Keys()".
OrderedSet is a set of strings that maintains the order of insertion.
PathIterator traverses through parts (directories and files) of some path.