utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckYaml

func CheckYaml(filename string) bool

CheckYaml check extension of filename

func Find

func Find(s string, keyword string) int

Find an alias of string.Index()

func FindFirstTemplate

func FindFirstTemplate(s string) (template string, exists bool, end int)

FindFirstTemplate find first template like ${xx}

func MergeStringMap

func MergeStringMap(dst *map[string]any, src map[string]any, lang string) (err error)

MergeStringMap deep merge map[string]any

func ParsePath

func ParsePath(path string) (paths []string, err error)

ParsePath parse string type path as slice

func ParseTemplates

func ParseTemplates(s string, replaceFunc func(template string) string) string

ParseTemplates parse all templates like ${xx} and replace it by replaceFunc

func WalkStringMap

func WalkStringMap(stringMap map[string]any, walkFun func(value any, path []string), path ...string)

WalkStringMap deep walk map[string]any

Types

This section is empty.

Jump to

Keyboard shortcuts

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