deref

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package deref provides a utility function to dereference a pointer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Of

func Of[E any](e *E) E

Of takes a pointer to a value of any type E and returns the value it points to. This function can be useful for simplifying code when working with pointers and their values.

Parameters:

e: A pointer to a value of any type E.

Returns:

E: The value pointed to by the input pointer.

Example usage:

pi := 3.141592
ptr := &pi
value := deref.Of(ptr) // value is 3.141592 (type float64)

Types

This section is empty.

Jump to

Keyboard shortcuts

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