strings

package
v0.151.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 1 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains added in v0.87.0

func Contains(list []string, value string) bool

Contains returns true if the value is contained in the string list.

func EmptyIfNil

func EmptyIfNil(s *string) string

EmptyIfNil returns an empty string if the provided *string is nil, or else the value the provided pointer points to.

func HasPrefix

func HasPrefix(s, prefix string) bool

HasPrefix tests whether the string s begins with prefix.

func NilIfEmpty

func NilIfEmpty(s string) *string

NilIfEmpty returns nil if the provided string is empty, or else a pointer to the provided string.

func NilPointersArrayIfEmpty

func NilPointersArrayIfEmpty(in []*string) []*string

NilPointersArrayIfEmpty returns nil if the provided []*string array is empty, or the provided array otherwise.

func NilPointersMapIfEmpty

func NilPointersMapIfEmpty(in map[string]*string) map[string]*string

NilPointersMapIfEmpty returns nil if the provided map[string]*string is empty, or the provided map otherwise.

func Pointer

func Pointer(s string) *string

Pointer returns a pointer to the provided string.

func ToPointersArray

func ToPointersArray(in []string) []*string

ToPointersArray converts the provided []string into a []*string.

func ToPointersMap

func ToPointersMap(in map[string]string) map[string]*string

ToPointersMap converts the provided map[string]string into a map[string]*string.

func ToValuesArray

func ToValuesArray(in []*string) []string

ToValuesArray converts the provided []*string into a []string.

func ToValuesMap

func ToValuesMap(in map[string]*string) map[string]string

ToValuesMap converts the provided map[string]*string into a map[string]string.

func Value added in v0.79.0

func Value(s *string) string

Value returns the value of a pointer, empty string if it's nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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