pathutil

package
v0.78.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonPrefix

func CommonPrefix(a, b string) string

func GetPath added in v0.78.0

func GetPath(m map[string]any, path string) (any, bool)

GetPath retrieves a value from a nested map using a dot-separated path. It supports accessing array elements using numeric indices in the path. For example, given the map:

{
  "user": {
    "name": "Alice",
    "addresses": [
      {"city": "New York"},
      {"city": "Los Angeles"}
    ]
  }
}

The path "user.name" would return "Alice", and the path "user.addresses.0.city" would return "New York".

Types

This section is empty.

Jump to

Keyboard shortcuts

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