helpers

package
v0.14.7 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MPL-2.0 Imports: 8 Imported by: 7 modules, 6 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 FormatSlice

func FormatSlice(a []string) string

func HasDuplicates added in v0.3.2

func HasDuplicates(resources []string) bool

func InterfaceSlice added in v0.7.2

func InterfaceSlice(slice interface{}) []interface{}

InterfaceSlice converts any interface{} into a []interface{} slice

func Sleep added in v0.11.0

func Sleep(ctx context.Context, dur time.Duration) error

Sleep pauses for the given duration or aborts immediately if the given context is canceled

func ToPointer added in v0.14.2

func ToPointer(v interface{}) interface{}

ToPointer takes an interface{} object and will return a pointer to this object if the object is not already a pointer. Otherwise, it will return the original value. It is safe to typecast the return-value of GetPointer into a pointer of the right type, except in very special cases (such as passing in nil without an explicit type)

func ToStringSliceE added in v0.8.10

func ToStringSliceE(i interface{}) ([]string, error)

func Uint64ToInt added in v0.12.1

func Uint64ToInt(i uint64) int

func Uint64ToInt64 added in v0.7.8

func Uint64ToInt64(i uint64) int64

Uint64ToInt64 if value is bigger than math.MaxInt64 return math.MaxInt64 otherwise returns original value casted to int64

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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