ref

package
v1.0.34 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package ref provides a utility function for creating a pointer to a value. It is designed to simplify the process of obtaining a pointer to a value of any type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Of

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

Of creates a pointer to the provided value of type 'E'. The primary purpose of this function is to simplify the creation of pointers to values without needing to use temporary variables.

Parameters:

e: The value of type 'E' to create a pointer for.

Returns:

*E: A pointer to the provided value 'e'.

Example usage:

intValue := 42
intPtr := ref.Of(intValue)
fmt.Println(*intPtr)

Types

This section is empty.

Jump to

Keyboard shortcuts

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