utils

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: MPL-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package utils provides generic utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Coalesce

func Coalesce[T comparable](vals ...T) T

Coalesce returns the first non-zero value.

func DeepCloneMap

func DeepCloneMap(src map[string]any) map[string]any

DeepCloneMap creates a deep copy of a map[string]any.

func DeepCloneSlice

func DeepCloneSlice(src []any) []any

DeepCloneSlice creates a deep copy of a slice of interfaces.

func Map

func Map[T, U any](ts []T, f func(T) U) []U

Map transforms a slice of T to a slice of U.

func MergeMaps

func MergeMaps[K comparable, V any](dst, src map[K]V) map[K]V

MergeMaps merges src into dst. Keys in src overwrite dst. Returns new map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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