text

package
v0.0.0-...-7b44a9b Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand

func Expand(text string, f func(string) string, options ...ExpandOption) string

func ExpandEnv

func ExpandEnv(text string, options ...ExpandOption) string

func GetEnvWithDefault

func GetEnvWithDefault(key string) string

GetEnvWithDefault get env and return default value if env not found eg:

 // Find the value of 'KEY' in env, and return 'HELLO' if 'KEY' not existed.
GetEnvWithDefault("KEY:HELLO")

Types

type ExpandOption

type ExpandOption func(o *expandOptions)

func WithExpandLeft

func WithExpandLeft(left []byte) ExpandOption

func WithExpandRight

func WithExpandRight(right []byte) ExpandOption

Jump to

Keyboard shortcuts

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