yaml

package
v5.0.0-beta.13 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Separator = "->"

Variables

View Source
var (
	ErrorInvalidSeparator = errors.New("error invalid Separator")
)

Functions

func DeepGet

func DeepGet(key string, data map[string]any) (res any, got bool)

DeepGet: get val

a:
  b:
    c: d

a->b->c => d

func PrettyMarshal

func PrettyMarshal(v any) ([]byte, error)

PrettyMarshal 这里想用 LiteralStyle, 不然前端显示的时候是一坨

func YamlDeepSetKey

func YamlDeepSetKey(field string, data any) ([]byte, error)

YamlDeepSetKey 把 'user->name: duc' 设置成

user:
  name: duc

Types

This section is empty.

Jump to

Keyboard shortcuts

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