util

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package util contains several utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChildPath

func ChildPath(base, target string) (string, error)

ChildPath returns the child path with respect to the base directory or returns an error if the target directory is not a child of the base directory.

func PathEvalAbs

func PathEvalAbs(path string) (string, error)

PathEvalAbs returns the absolute path for a directory after evaluating symlinks.

func Ptr

func Ptr[T any](v T) *T

Ptr returns the pointer of a given value.

func PtrVal

func PtrVal[T any](v *T) T

PtrVal returns the value of the given pointer. If the provided input is nil, it returns the zero value for the pointer's underlying type.

func SortedMapKeys

func SortedMapKeys[M ~map[K]V, K cmp.Ordered, V any](m M) []K

SortedMapKeys returns the sorted slice of map key strings.

Types

This section is empty.

Jump to

Keyboard shortcuts

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