pointer

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: MIT Imports: 1 Imported by: 0

README

pointer

Abstractions for creating pointers to non-addressable Go primitives.

For example,

func somefunc() int64 {
  return 1
}
val := &somefunc()
./README.md:9:9: cannot take the address of somefunc()

Instead,

func somefunc() int64 {
  return 1
}
val := pointer.Int64(somefunc())

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

Bool returns a pointer to the specified bool value.

func Byte

func Byte(v byte) *byte

Byte returns a pointer to the specified byte value.

func Complex64

func Complex64(v complex64) *complex64

Complex64 returns a pointer to the specified complex64 value.

func Complex128

func Complex128(v complex128) *complex128

Complex128 returns a pointer to the specified complex128 value.

func Duration

func Duration(v time.Duration) *time.Duration

Duration returns a pointer to the specified duration value.

func Float32

func Float32(v float32) *float32

Float32 returns a pointer to the specified float32 value.

func Float64

func Float64(v float64) *float64

Float64 returns a pointer to the specified float64 value.

func Int

func Int(v int) *int

Int returns a pointer to the specified int value.

func Int8

func Int8(v int8) *int8

Int8 returns a pointer to the specified int8 value.

func Int16

func Int16(v int16) *int16

Int16 returns a pointer to the specified int16 value.

func Int32

func Int32(v int32) *int32

Int32 returns a pointer to the specified int32 value.

func Int64

func Int64(v int64) *int64

Int64 returns a pointer to the specified int64 value.

func Rune

func Rune(v rune) *rune

Rune returns a pointer to the specified rune value.

func String

func String(v string) *string

String returns a pointer to the specified string value.

func Time

func Time(v time.Time) *time.Time

Time returns a pointer to the specified time value.

func Uint

func Uint(v uint) *uint

Uint returns a pointer to the specified uint value.

func Uint8

func Uint8(v uint8) *uint8

Uint8 returns a pointer to the specified uint8 value.

func Uint16

func Uint16(v uint16) *uint16

Uint16 returns a pointer to the specified uint16 value.

func Uint32

func Uint32(v uint32) *uint32

Uint32 returns a pointer to the specified uint32 value.

func Uint64

func Uint64(v uint64) *uint64

Uint64 returns a pointer to the specified uint64 value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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