csstring

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 2 Imported by: 6 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Interpolate

func Interpolate(s string, data any) (string, error)

Interpolate fills a string template with the given values, can be map or struct. example: Interpolate("{{.Name}}", map[string]string{"Name": "JohnDoe"})

func StrictExpand

func StrictExpand(s string, mapping func(string) (string, bool)) string

StrictExpand replaces ${var} or $var in the string according to the mapping function, like os.Expand. The difference is that the mapping function returns a boolean indicating whether the variable was found. If the variable was not found, the string is not modified.

Whereas os.ExpandEnv uses os.Getenv, here we can use os.LookupEnv to distinguish between an empty variable and an undefined one.

Types

This section is empty.

Jump to

Keyboard shortcuts

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