util

package
v3.11.25 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendPanicPackagePrefix added in v3.11.18

func AppendPanicPackagePrefix(name, packagePrefix string)

func CatchTerminate

func CatchTerminate(f func()) (status bool)

func Command

func Command(ctx context.Context, log logger.MessageInterface, prog string, args ...string) string

func CommandWithErr

func CommandWithErr(ctx context.Context, options CommandOptions, prog string, args ...string) (err error)

func CommandWithOptions

func CommandWithOptions(ctx context.Context, options CommandOptions, prog string, args ...string) string

func ConvertMap

func ConvertMap[FromType, ToType any](objects []FromType, converter func(f FromType) ToType) []ToType

func FileExists

func FileExists(pathname string) bool

func IsDir added in v3.11.6

func IsDir(dir string) bool

func MaybeTerminate

func MaybeTerminate(ctx context.Context)

func PanicToError

func PanicToError(fun func()) (err error)

func ParseInt

func ParseInt(s string) int64

func RandSeq

func RandSeq(n int) string

func ReadDir added in v3.11.6

func ReadDir(pathname string) []fs.DirEntry

func Retry

func Retry(fun func(), tries int)

func SetSysProcAttribute

func SetSysProcAttribute(cmd *exec.Cmd)

func ToString added in v3.11.10

func ToString[T any](some T) string

Types

type CommandOptions

type CommandOptions struct {
	ExitCodes []int
	Log       logger.MessageInterface
}

type PanicError

type PanicError interface {
	error
	Stack() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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