utils

package
v1.0.53 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepClone

func DeepClone(v any) (any, error)

DeepClone performs deep cloning without YAML marshaling

func Ext

func Ext(path string) string

func FilterList

func FilterList(l []any, filter func(any) ([]any, error)) ([]any, error)

func FilterMap

func FilterMap(m map[string]any, filter func(string, any) (map[string]any, error)) (map[string]any, error)

func GetMapBoolValue

func GetMapBoolValue(m map[string]any, k string) (bool, bool)

func GetMapIntValue

func GetMapIntValue(m map[string]any, k string) (int, bool)

func HasListMapBoolValue

func HasListMapBoolValue(l []any, k string, v bool) bool

func HasMapBoolValue

func HasMapBoolValue(m map[string]any, k string, v bool) bool

func IsStdin

func IsStdin(path string) bool

func MakePathsAbsolute

func MakePathsAbsolute(paths []string, workingDir string) ([]string, error)

MakePathsAbsolute converts relative paths to absolute paths using the provided working directory.

func PopListMapBoolValue

func PopListMapBoolValue(l []any, k string, v bool) (bool, []any, error)

func PopListMapValue

func PopListMapValue(l []any, k string) (any, []any, error)

func PopListString

func PopListString(l []any, v string) (bool, []any)

func PopMapBoolValue

func PopMapBoolValue(m map[string]any, k string, v bool) (bool, map[string]any)

func PopMapValue

func PopMapValue(m map[string]any, k string) (bool, any, map[string]any)

func PreparePathsForParser

func PreparePathsForParser(paths []string, rootPath string, workingDir string) ([]string, error)

PreparePathsForParser prepares paths by making them absolute and rebasing to root.

func RebasePathsToRoot

func RebasePathsToRoot(absPaths []string, rootPath string, workingDir string) ([]string, error)

RebasePathsToRoot rebases absolute paths to be relative to the root path.

func SortedMap

func SortedMap[Map ~map[K]V, K cmp.Ordered, V any](m Map) iter.Seq2[K, V]

func ToBool

func ToBool(a any) (bool, bool)

func ToInt

func ToInt(a any) (int, bool)

func ToString

func ToString(a any) string

func ToStringList

func ToStringList(l []any) ([]string, error)

func ToStringListPermissive

func ToStringListPermissive(v any) ([]string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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