util

package
v0.45.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneMap added in v0.40.1

func CloneMap[K comparable, V any](src map[K]V) map[K]V

func CloneSlice added in v0.23.6

func CloneSlice[T any](src []T) []T

func Contains added in v0.33.4

func Contains(s, substr string) bool

func DedupeNonEmptyStrings

func DedupeNonEmptyStrings(values []string) []string

DedupeNonEmptyStrings returns a copy of values without empty strings or duplicates, preserving order.

func DedupeSortedStrings added in v0.17.1

func DedupeSortedStrings(values []string) []string

DedupeSortedStrings removes consecutive duplicates from a sorted slice.

func FirstTrimmed added in v0.28.1

func FirstTrimmed(values ...string) string

func HasPrefix added in v0.33.4

func HasPrefix(s, prefix string) bool

func Lower added in v0.37.1

func Lower(s string) string

func LowerTrim added in v0.28.1

func LowerTrim(s string) string

func SamePath added in v0.35.1

func SamePath(a, b string) bool

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

func SamePathOrBothEmpty(a, b string) bool

SamePathOrBothEmpty reports whether a and b are both empty or name the same path.

func SortedKeys added in v0.23.6

func SortedKeys[M ~map[K]V, K ~string, V any](m M) []K

func Trim added in v0.28.1

func Trim(s string) string

func TrimLeadingOnce added in v0.28.1

func TrimLeadingOnce(s string) string

func TrimLeft added in v0.28.1

func TrimLeft(s string) string

func TrimRight added in v0.28.1

func TrimRight(s string) string

func UpperTrim added in v0.28.1

func UpperTrim(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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