to

package
v11.7.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package to provides helpers to ease working with pointer values of marshalled structures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b *bool) bool

Bool returns a bool value for the passed bool pointer. It returns false if the pointer is nil.

func BoolPtr

func BoolPtr(b bool) *bool

BoolPtr returns a pointer to the passed bool.

func Float32

func Float32(i *float32) float32

Float32 returns an int value for the passed int pointer. It returns 0.0 if the pointer is nil.

func Float32Ptr

func Float32Ptr(i float32) *float32

Float32Ptr returns a pointer to the passed float32.

func Float64

func Float64(i *float64) float64

Float64 returns an int value for the passed int pointer. It returns 0.0 if the pointer is nil.

func Float64Ptr

func Float64Ptr(i float64) *float64

Float64Ptr returns a pointer to the passed float64.

func Int

func Int(i *int) int

Int returns an int value for the passed int pointer. It returns 0 if the pointer is nil.

func Int32

func Int32(i *int32) int32

Int32 returns an int value for the passed int pointer. It returns 0 if the pointer is nil.

func Int32Ptr

func Int32Ptr(i int32) *int32

Int32Ptr returns a pointer to the passed int32.

func Int64

func Int64(i *int64) int64

Int64 returns an int value for the passed int pointer. It returns 0 if the pointer is nil.

func Int64Ptr

func Int64Ptr(i int64) *int64

Int64Ptr returns a pointer to the passed int64.

func IntPtr

func IntPtr(i int) *int

IntPtr returns a pointer to the passed int.

func String

func String(s *string) string

String returns a string value for the passed string pointer. It returns the empty string if the pointer is nil.

func StringMap

func StringMap(msp map[string]*string) map[string]string

StringMap returns a map of strings built from the map of string pointers. The empty string is used for nil pointers.

func StringMapPtr

func StringMapPtr(ms map[string]string) *map[string]*string

StringMapPtr returns a pointer to a map of string pointers built from the passed map of strings.

func StringPtr

func StringPtr(s string) *string

StringPtr returns a pointer to the passed string.

func StringSlice

func StringSlice(s *[]string) []string

StringSlice returns a string slice value for the passed string slice pointer. It returns a nil slice if the pointer is nil.

func StringSlicePtr

func StringSlicePtr(s []string) *[]string

StringSlicePtr returns a pointer to the passed string slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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