langx

package
v0.0.0-...-919abb7 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MPL-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package langx provides small utility functions to extend the standard golang language.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Autoderef

func Autoderef[T any](a *T) (zero T)

Autoderef safely converts a pointer to its value, uses the zero value for nil.

func Autoptr

func Autoptr[T any](a T) *T

Autoptr converts a value into a pointer

func Clone

func Clone[T any, Y ~func(*T)](v T, options ...Y) T

func DefaultIfZero

func DefaultIfZero[T comparable](fallback T, v T) T

func DerefOrZero

func DerefOrZero[T any](a *T) (zero T)

func Must

func Must[T any](v T, err error) T

func MustZero

func MustZero[T any](v T, err error) T

Types

This section is empty.

Jump to

Keyboard shortcuts

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