util

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEnvNotSet = errors.New("environment variable not set")
View Source
var ErrUnsupportedEnvType = errors.New("unsupported env type")

Functions

func AddToTar

func AddToTar(tarWriter *tar.Writer, filePath, archivePath string) error

func CheckExist

func CheckExist(path string) error

func Clamp

func Clamp(v, minV, maxV int) int

func CoalescePtr

func CoalescePtr[T any](values ...*T) *T

func ContainsMainGo

func ContainsMainGo(dir string) bool

func FindGoModDir

func FindGoModDir(startDir string) string

func FindMainGoFile

func FindMainGoFile(binaryPath string) (string, error)

func FormatBytes

func FormatBytes(bytes uint64) string

func GetEnv

func GetEnv[T any](key string) (*T, error)

func IsExcludedBinaryDir

func IsExcludedBinaryDir(name string) bool

func MatchAnyFilepathGlob

func MatchAnyFilepathGlob(file string, patterns []string) bool

func NilAsZero

func NilAsZero[T any](opt *T) T

func NormalizeExePath

func NormalizeExePath(path string) string

func ResolveEnvOption

func ResolveEnvOption[T any](key string) *T

func SetEnvs

func SetEnvs(envMap map[string]string) (func(), error)

func StdoutIsTerminal

func StdoutIsTerminal() bool

Types

type TempStorageInfo

type TempStorageInfo struct {
	InMemory      bool
	AvailableDisk uint64
}

func ResolveTempStorageInfo

func ResolveTempStorageInfo(tempRoot string) TempStorageInfo

Jump to

Keyboard shortcuts

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