stringutils

package
v1.4.15 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2017 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contract

func Contract(m map[string]string, f func(string, string) string) []string

Contract takes a map[string]string and condition contracts pairs of key and values.

func DefaultIf

func DefaultIf(value, defaultValue, condition string) string

DefaultIf falls back to a default value if the passed value is equal to the condition parameter.

func DefaultIfEmpty

func DefaultIfEmpty(value, defaultValue string) string

DefaultIfEmpty falls back to a default value if the passed value is empty

func ErrorMessages

func ErrorMessages(errs []error) []string

ErrorMessages accumulates the error messages from slice of errors.

func Quote

func Quote(s []string) []string

Quote takes a slice of strings and returns a slice of strings where each element of the input is put in double quotation marks.

func StringKeys

func StringKeys(m map[string]string) []string

StringKeys extracts the key of a map[string]string and returns them as a slice of strings.

func Transform

func Transform(s []string, f func(string) string) []string

Transform takes a slice of strings, transforms each element and returns a slice of strings containing the transformed values

Types

This section is empty.

Jump to

Keyboard shortcuts

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