Help us shape the future of Go! Take the 2026 Go Developer Survey

ptr

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ptr provides some helpers for converting types to pointers

Index

Constants

This section is empty.

Variables

View Source
var (
	// False is false pointer
	False = Bool(false)
	// True is a true pointer
	True = Bool(true)
)

Functions

func Bool

func Bool(val interface{}, def ...bool) *bool

Bool returns a bool pointer

func Duration

func Duration(val interface{}) *time.Duration

Duration is a safe time.Duration pointer wrapper

func Float64

func Float64(val interface{}) *float64

Float64 is a safe float64 pointer wrapper

func Int added in v1.4.7

func Int(val interface{}) *int

Int is a safe int pointer wrapper

func Int64

func Int64(val interface{}) *int64

Int64 is a safe int64 pointer wrapper

func String

func String(val interface{}) *string

String is a safe string pointer wrapper

Types

This section is empty.

Jump to

Keyboard shortcuts

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