Documentation
¶
Overview ¶
Package dirlist implements functions to manipulate PATH-like environment variables.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
type List interface {
// Reset resets the list of directories to an empty slice.
Reset()
// Contains returns true if the list contains the path.
Contains(string) bool
// Load reads the list of directories from a string.
Load(string)
// LoadEnv parses the value of an environment variable. It expects
// the value to be a string of directories separates by the rune
// filepath.ListSeparator.
LoadEnv(string)
// Prepend the list with a path.
Prepend(string)
// Append a path to the list.
Append(string)
// Drop remove a path from the list.
Drop(string)
// Slice returns the path list as a slice of strings.
Slice() []string
// String returns the path list as a string of path list
// separator-separated directories.
String() string
}
List builds a list of directories by parsing PATH-like variables and can perform operations on it such as append, prepend, or remove, while keeping the list duplicate-free.
Click to show internal directories.
Click to hide internal directories.