gopointer

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: MIT Imports: 1 Imported by: 1

README

gopointer

A utility to allow one-line creation of pointer of primitive values.

Example:

    strPtr := gopointer.OfString("a string")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OfBool

func OfBool(b bool) *bool

OfBool returns the pointer to the given bool

func OfFloat32

func OfFloat32(f float32) *float32

OfFloat32 returns the pointer to the given float32

func OfFloat64

func OfFloat64(f float64) *float64

OfFloat64 returns the pointer to the given float64

func OfInt

func OfInt(i int) *int

OfInt returns the pointer to the given int

func OfInt64

func OfInt64(i64 int64) *int64

OfInt64 returns the pointer to the given int64

func OfNilJSON

func OfNilJSON() *[]byte

OfNilJSON returns the pointer to a nil JSON bytes

func OfNilTime

func OfNilTime() *time.Time

OfNilTime returns nil value of the *time.Time type

func OfString

func OfString(str string) *string

OfString returns the pointer to the given string

func OfTime

func OfTime(t time.Time) *time.Time

OfTime returns the pointer to the given time

Types

This section is empty.

Jump to

Keyboard shortcuts

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