converter

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToPointer

func ToPointer[E any](toConvert E) *E

ToPointer converts any type (E) to pointer (*E)

func ToPointerOrNil

func ToPointerOrNil[T constraints.Ordered](toConvert T) *T

ToPointerOrNil converts like ToPointer but returns nil if toConvert is a zero value.

func ToValue

func ToValue[E any](toConvert *E) E

ToValue converts any pointer (*E) to value (E). Panics if toConvert is a nil pointer.

func ToValueOrZero

func ToValueOrZero[T constraints.Ordered](toConvert *T) T

ToValueOrZero converts like ToValue but returns a zero value if toConvert is nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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