to – github.com/Azure/go-autorest/autorest/to Index | Files
Deprecated: use github.com/Azure/azure-sdk-for-go/sdk/azcore/to instead.

package to

import "github.com/Azure/go-autorest/autorest/to"

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

Index

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 ByteSlicePtr

func ByteSlicePtr(b []byte) *[]byte

ByteSlicePtr returns a pointer to the passed byte slice.

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.

Source Files

convert.go

Version
v0.4.1 (latest)
Published
Jan 28, 2025
Platform
windows/amd64
Last checked
3 weeks ago

Tools for package owners.