util

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearTempDir

func ClearTempDir()

ClearTempDir removes the temporary directory (if present) and resets the state. This is not safe for concurrent use and is meant for cleanup in unit tests only.

func CopyRef

func CopyRef[T any](value T) *T

CopyRef returns a pointer to a copy of value

func ElementType

func ElementType(initial reflect.Type) (et reflect.Type)

ElementType returns the type after removing all reflect.Array, reflect.Chan, reflect.Map, reflect.Pointer and reflect.Slice

func MustGetTempDir

func MustGetTempDir() string

MustGetTempDir returns the dir from TempDir or panics if an error occurred

func NilOr

func NilOr[T comparable](value *T, expected T) bool

NilOr returns true if value is nil or expected

func NotNilAnd

func NotNilAnd[T comparable](value *T, expected T) bool

NotNilAnd returns true if value is not nil and expected

func TempDir

func TempDir() (string, error)

TempDir returns the path to a temporary directory that is stable within the same process and cleaned when shutdown.RunHooks is invoked

func UnpackValue

func UnpackValue(value reflect.Value) (v reflect.Value, isNil bool)

UnpackValue dereferences reflect.Pointer and reflect.Interface values

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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