ptr

package
v0.0.0-...-ef83997 Latest Latest
Warning

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

Go to latest
Published: May 2, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package ptr provides functions to create on the fly pointer values for some built-in types. This might seem stupid but in our codebase we have a lot of places in which we just need to create variable just to get the pointer to it. That clutters the code a lot and causes distraction. Most of the time those strings are just throw-away constants and the pointer "is not really important later".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(o bool) *bool

Bool returns the pointer to the given bool.

func Float32

func Float32(o float32) *float32

Float32 returns the pointer to the given float32.

func Float64

func Float64(o float64) *float64

Float64 returns the pointer to the given float32.

func Int

func Int(o int) *int

Int returns the pointer to the given int.

func Int16

func Int16(o int16) *int16

Int16 returns the pointer to the given int16.

func Int32

func Int32(o int32) *int32

Int32 returns the pointer to the given int32.

func Int64

func Int64(o int64) *int64

Int64 returns the pointer to the given int64.

func Int8

func Int8(o int8) *int8

Int8 returns the pointer to the given int8.

func Interface

func Interface(o interface{}) *interface{}

Interface returns the pointer to the given interface.

func String

func String(o string) *string

String returns the pointer to the given string.

func Time

func Time(o time.Time) *time.Time

Time returns the pointer to the given time.Time.

func UUID

func UUID(o uuid.UUID) *uuid.UUID

UUID returns the pointer to the given uuid.UUID.

func Uint

func Uint(o uint) *uint

Uint returns the pointer to the given uint.

func Uint16

func Uint16(o uint16) *uint16

Uint16 returns the pointer to the given uint16.

func Uint32

func Uint32(o uint32) *uint32

Uint32 returns the pointer to the given uint32.

func Uint64

func Uint64(o uint64) *uint64

Uint64 returns the pointer to the given uint64.

func Uint8

func Uint8(o uint8) *uint8

Uint8 returns the pointer to the given uint8.

Types

This section is empty.

Jump to

Keyboard shortcuts

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