pathutil

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(data any, parts []string) (any, error)

Get retrieves a value from a nested structure using a slice of path parts. It returns an error if the path is not found or cannot be traversed.

func GetString

func GetString(data any, path string) (string, error)

GetString retrieves a value from a nested structure using a dot-separated path string and converts it to a string. Returns an error if the path is not found or cannot be traversed.

func Set

func Set(data map[string]any, parts []string, value any)

Set sets a value at a path in a nested map structure. It creates intermediate maps as needed.

func SplitPath

func SplitPath(path string) []string

SplitPath splits a dot-separated path string into parts.

Types

This section is empty.

Jump to

Keyboard shortcuts

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