utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandDirectory

func ExpandDirectory(logger io.Logger, dir, wsPath, execPath string, env map[string]string) string

ExpandDirectory expands the directory field of an executable to an absolute path. The following transformations are applied: - empty dir -> execPath (directory portion) - // -> wsPath + dir path (workspace-specific) - all other paths -> delegated to ExpandPath If the input contains a filename, returns just the directory portion.

func ExpandPath

func ExpandPath(logger io.Logger, path, fallbackDir string, env map[string]string) string

ExpandPath expands a general path to an absolute path with security validation. The following transformations are applied: - empty path -> fallbackPath (directory portion) - ~/path -> home directory + path - ./path or . -> current working directory + path - /path -> absolute path - relative path -> fallbackPath (directory portion) + path - ${envVar} -> expanded to the value from env map.

func IsZeroValue

func IsZeroValue(v interface{}) bool

func PathFromWd

func PathFromWd(path string) (string, error)

func ValidateOneOf

func ValidateOneOf(fieldName string, vals ...interface{}) error

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