Documentation
¶
Index ¶
- func AllBlank(lines []string) bool
- func Contains(s, substr string) bool
- func DedupeNonEmptyStrings(values []string) []string
- func DedupeSortedStrings(values []string) []string
- func ExpandHome(path string) string
- func FirstTrimmed(values ...string) string
- func FoldLines(s string) string
- func HasPrefix(s, prefix string) bool
- func Lower(s string) string
- func LowerTrim(s string) string
- func SameFile(a, b string) bool
- func SamePath(a, b string) bool
- func SamePathOrBothEmpty(a, b string) bool
- func SortedKeys[M ~map[K]V, K ~string, V any](m M) []K
- func Trim(s string) string
- func TrimLeadingOnce(s string) string
- func TrimLeft(s string) string
- func TrimRight(s string) string
- func UpperTrim(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DedupeNonEmptyStrings ¶
DedupeNonEmptyStrings returns a copy of values without empty strings or duplicates, preserving order.
func DedupeSortedStrings ¶ added in v0.17.1
DedupeSortedStrings removes consecutive duplicates from a sorted slice.
func ExpandHome ¶ added in v1.1.0
func FirstTrimmed ¶ added in v0.28.1
func FoldLines ¶ added in v0.53.1
FoldLines trims each line, drops blank lines, and joins the rest with spaces. A string without line breaks is returned unchanged.
func SameFile ¶ added in v0.49.1
SameFile reports whether two paths name one file on disk. Use it instead of SamePath when the same file can reach the caller under more than one name, as happens through a symlink or on a case insensitive filesystem.
func SamePath ¶ added in v0.35.1
SamePath reports whether two non-empty paths resolve to the same lexical path.
It does not stat files or resolve symlinks; use os.SameFile with os.Stat results when physical file identity is required.
func SamePathOrBothEmpty ¶ added in v0.35.1
SamePathOrBothEmpty reports whether a and b are both empty or name the same path.
func SortedKeys ¶ added in v0.23.6
func TrimLeadingOnce ¶ added in v0.28.1
Types ¶
This section is empty.