str

package
v0.0.0-...-df423d5 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyToString

func AnyToString(a any) (string, error)

func AnyValueToString

func AnyValueToString(k string, m map[string]any) (string, error)

func First

func First(vs ...string) string

First returns the first non-zero valued string

func FirstIn

func FirstIn(m map[string]any, keys ...string) string

FirstIn returns the first entry in the map with a non-zero value when iterating the provided list of keys.

func GenerateHash

func GenerateHash(input []byte) string

func ParseBool

func ParseBool(v string) bool

parseBool returns the bool value represented by the string or false on error

func Preview

func Preview(s string, size int) string

Preview reduces the string to the specified size. If the string is longer than the size, the last three characters are replaced with an ellipsis. Size < 4 will default to 4. ex: Preview("123", 6) => "123" Preview("1234567", 6) "123..."

func SliceToMap

func SliceToMap(ss []string) map[string]struct{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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