convert

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: GPL-3.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidDestinationType = "invalid destination type, expected: '%s'"
	ErrParseIntFailed         = "cannot parse '%s', expected integer"
	ErrParseInt8Failed        = "cannot parse '%s', expected integer of 8 bits"
	ErrParseInt16Failed       = "cannot parse '%s', expected integer of 16 bits"
	ErrParseInt32Failed       = "cannot parse '%s', expected integer of 32 bits"
	ErrParseInt64Failed       = "cannot parse '%s', expected integer of 64 bits"
	ErrParseUintFailed        = "cannot parse '%s', expected unsigned integer"
	ErrParseUint8Failed       = "cannot parse '%s', expected unsigned integer of 8 bits"
	ErrParseUint16Failed      = "cannot parse '%s', expected unsigned integer of 16 bits"
	ErrParseUint32Failed      = "cannot parse '%s', expected unsigned integer of 32 bits"
	ErrParseUint64Failed      = "cannot parse '%s', expected unsigned integer of 64 bits"
	ErrParseFloat32Failed     = "cannot parse '%s', expected float of 32 bits"
	ErrParseFloat64Failed     = "cannot parse '%s', expected float of 64 bits"
	ErrParseBoolFailed        = "cannot parse '%s', expected boolean"
	ErrInvalidDurationUnit    = "invalid duration unit, expected: '%s'"
)

Functions

func ErrorArrayToStringArray

func ErrorArrayToStringArray(errorArray *[]error) *[]string

ErrorArrayToStringArray maps an array of errors to an array of strings

func PrettyDuration added in v0.1.10

func PrettyDuration(d time.Duration, minUnit string) (string, error)

PrettyDuration formats a duration without zero units

func ToBool added in v0.1.2

func ToBool(value string, dest interface{}) error

ToBool sets the destination to the value of the string as a bool

func ToFloat32 added in v0.1.2

func ToFloat32(value string, dest interface{}) error

ToFloat32 sets the destination to the value of the string as a float32

func ToFloat64 added in v0.1.2

func ToFloat64(value string, dest interface{}) error

ToFloat64 sets the destination to the value of the string as a float64

func ToInt added in v0.1.2

func ToInt(value string, dest interface{}) error

ToInt sets the destination to the value of the string as an int

func ToInt16 added in v0.1.2

func ToInt16(value string, dest interface{}) error

ToInt16 sets the destination to the value of the string as an int16

func ToInt32 added in v0.1.2

func ToInt32(value string, dest interface{}) error

ToInt32 sets the destination to the value of the string as an int32

func ToInt64 added in v0.1.2

func ToInt64(value string, dest interface{}) error

ToInt64 sets the destination to the value of the string as an int64

func ToInt8 added in v0.1.2

func ToInt8(value string, dest interface{}) error

ToInt8 sets the destination to the value of the string as an int8

func ToString added in v0.1.8

func ToString(value string, dest interface{}) error

ToString sets the destination to the value of the string

func ToUint added in v0.1.2

func ToUint(value string, dest interface{}) error

ToUint sets the destination to the value of the string as an uint

func ToUint16 added in v0.1.2

func ToUint16(value string, dest interface{}) error

ToUint16 sets the destination to the value of the string as an uint16

func ToUint32 added in v0.1.2

func ToUint32(value string, dest interface{}) error

ToUint32 sets the destination to the value of the string as an uint32

func ToUint64 added in v0.1.2

func ToUint64(value string, dest interface{}) error

ToUint64 sets the destination to the value of the string as an uint64

func ToUint8 added in v0.1.2

func ToUint8(value string, dest interface{}) error

ToUint8 sets the destination to the value of the string as an uint8

Types

This section is empty.

Jump to

Keyboard shortcuts

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