strings

package
v0.173.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 1 Imported by: 3 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 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