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

utils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Age added in v0.38.4

func Age(d time.Duration) string

func Contains added in v0.38.260

func Contains[T comparable](arr []T, item T) bool

func Deref added in v1.0.18

func Deref[T any](v *T, zeroVal ...T) T

func FreePort added in v1.0.152

func FreePort() int

func GenerateJSONMD5Hash added in v0.38.181

func GenerateJSONMD5Hash(obj interface{}) (string, error)

GenerateJSONMD5Hash marshals the object into JSON and generates its md5 hash

func IsMapIdentical added in v1.0.260

func IsMapIdentical[K comparable](map1, map2 map[string]K) bool

func MapKeys added in v1.0.52

func MapKeys[T any](m map[string]T) []string

func ParseTime added in v1.0.260

func ParseTime(t string) *time.Time

func Ptr added in v0.38.335

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

func SetDifference added in v0.38.160

func SetDifference[T comparable](a, b []T) []T

SetDifference returns the list of elements present in a but not present in b

func ToJSONMap added in v1.1.2

func ToJSONMap(s any) (map[string]any, error)

ToJSONMap takes an input value of struct or map type and converts it to a map[string]any representation using JSON encoding and decoding.

func UUIDsToStrings added in v0.38.257

func UUIDsToStrings(in []uuid.UUID) []string

Types

type NamedLock added in v1.0.118

type NamedLock struct {
	// contains filtered or unexported fields
}

func (*NamedLock) TryLock added in v1.0.118

func (n *NamedLock) TryLock(name string, timeout time.Duration) Unlocker

type Unlocker added in v1.0.118

type Unlocker interface {
	Release()
}

Jump to

Keyboard shortcuts

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