Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdHelp

func CmdHelp(cmd *cobra.Command, _ []string)

CmdHelp is used to explicitly set the Run function for non-leaf commands to the command help function, so that we can catch invalid commands This is a workaround needed due to the open issue on the Cobra repo: https://github.com/spf13/cobra/issues/706

func ConvertInt64PToFloat64P added in v0.2.3

func ConvertInt64PToFloat64P(i *int64) *float64

ConvertInt64PToFloat64P converts an int64 pointer to a float64 pointer This function will return nil if the input is nil

func Float64Ptr added in v0.2.3

func Float64Ptr(f float64) *float64

Float64Ptr returns a pointer to a float64 Needed because the Ptr function only returns pointer to float

func Int64Ptr added in v0.2.3

func Int64Ptr(i int64) *int64

Int64Ptr returns a pointer to an int64 Needed because the Ptr function only returns pointer to int

func JoinStringKeys added in v0.21.0

func JoinStringKeys(m map[string]any, sep string) string

JoinStringKeys concatenates the string keys of a map, each separatore by the [sep] string.

func JoinStringKeysPtr added in v0.21.0

func JoinStringKeysPtr(m map[string]any, sep string) string

JoinStringKeysPtr concatenates the string keys of a map pointer, each separatore by the [sep] string.

func Ptr

func Ptr[T any](v T) *T

Ptr Returns the pointer to any type T

func PtrString added in v0.20.0

func PtrString[T any](t *T) string

PtrString creates a string representation of a passed object pointer or returns an empty string, if the passed object is _nil_.

func ValidateURLDomain added in v0.12.0

func ValidateURLDomain(value string) error

func ValidateUUID

func ValidateUUID(value string) error

ValidateUUID validates if the provided string is a valid UUID

Types

This section is empty.

Jump to

Keyboard shortcuts

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