cast

package module
v0.0.0-...-157127d Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: MIT Imports: 10 Imported by: 0

README

Cast

Fork from https://github.com/spf13/cast and add some features.

Documentation

Overview

Package cast provides easy and safe casting in Go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFloat32

func AddFloat32(a, b float32) (r decimal.Decimal)

func AddFloat64

func AddFloat64(a, b float64) (r decimal.Decimal)

func AddInt16E

func AddInt16E(a, b int16) (r int16, err error)

func AddInt32E

func AddInt32E(a, b int32) (r int32, err error)

func AddInt64E

func AddInt64E(a, b int64) (r int64, err error)

func AddInt8E

func AddInt8E(a, b int8) (r int8, err error)

func AddIntE

func AddIntE(a, b int) (r int, err error)

func AddUint16E

func AddUint16E(a, b uint16) (r uint16, err error)

func AddUint32E

func AddUint32E(a, b uint32) (r uint32, err error)

func AddUint64E

func AddUint64E(a, b uint64) (r uint64, err error)

func AddUint8E

func AddUint8E(a, b uint8) (r uint8, err error)

func AddUintE

func AddUintE(a, b uint) (r uint, err error)

func BigAddInt64

func BigAddInt64(a, b int64) *big.Int

func BigAddUint64

func BigAddUint64(a, b uint64) *big.Int

func BigDivInt64

func BigDivInt64(a, b int64) *big.Int

func BigDivUint64

func BigDivUint64(a, b uint64) *big.Int

func BigMulInt64

func BigMulInt64(a, b int64) *big.Int

func BigMulUint64

func BigMulUint64(a, b uint64) *big.Int

func BigSubInt64

func BigSubInt64(a, b int64) *big.Int

func BigSubUint64

func BigSubUint64(a, b uint64) *big.Int

func DivFloat32

func DivFloat32(a, b float32) (r decimal.Decimal)

func DivFloat64

func DivFloat64(a, b float64) (r decimal.Decimal)

func DivInt16E

func DivInt16E(a, b int16) (r int16, err error)

func DivInt32E

func DivInt32E(a, b int32) (r int32, err error)

func DivInt64E

func DivInt64E(a, b int64) (r int64, err error)

func DivInt8E

func DivInt8E(a, b int8) (r int8, err error)

func DivIntE

func DivIntE(a, b int) (r int, err error)

func DivUint16E

func DivUint16E(a, b uint16) (r uint16, err error)

func DivUint32E

func DivUint32E(a, b uint32) (r uint32, err error)

func DivUint64E

func DivUint64E(a, b uint64) (r uint64, err error)

func DivUint8E

func DivUint8E(a, b uint8) (r uint8, err error)

func DivUintE

func DivUintE(a, b uint) (r uint, err error)

func MulFloat32

func MulFloat32(a, b float32) (r decimal.Decimal)

func MulFloat64

func MulFloat64(a, b float64) (r decimal.Decimal)

func MulInt16E

func MulInt16E(a, b int16) (r int16, err error)

func MulInt32E

func MulInt32E(a, b int32) (r int32, err error)

func MulInt64E

func MulInt64E(a, b int64) (r int64, err error)

func MulInt8E

func MulInt8E(a, b int8) (r int8, err error)

func MulIntE

func MulIntE(a, b int) (r int, err error)

func MulUint16E

func MulUint16E(a, b uint16) (r uint16, err error)

func MulUint32E

func MulUint32E(a, b uint32) (r uint32, err error)

func MulUint64E

func MulUint64E(a, b uint64) (r uint64, err error)

func MulUint8E

func MulUint8E(a, b uint8) (r uint8, err error)

func MulUintE

func MulUintE(a, b uint) (r uint, err error)

func StringToDate

func StringToDate(s string) (time.Time, error)

StringToDate attempts to parse a string into a time.Time type using a predefined list of formats. If no suitable format is found, an error is returned.

func SubFloat32

func SubFloat32(a, b float32) (r decimal.Decimal)

func SubFloat64

func SubFloat64(a, b float64) (r decimal.Decimal)

func SubInt16E

func SubInt16E(a, b int16) (r int16, err error)

func SubInt32E

func SubInt32E(a, b int32) (r int32, err error)

func SubInt64E

func SubInt64E(a, b int64) (r int64, err error)

func SubInt8E

func SubInt8E(a, b int8) (r int8, err error)

func SubIntE

func SubIntE(a, b int) (r int, err error)

func SubUint16E

func SubUint16E(a, b uint16) (r uint16, err error)

func SubUint32E

func SubUint32E(a, b uint32) (r uint32, err error)

func SubUint64E

func SubUint64E(a, b uint64) (r uint64, err error)

func SubUint8E

func SubUint8E(a, b uint8) (r uint8, err error)

func SubUintE

func SubUintE(a, b uint) (r uint, err error)

func ToBoolE

func ToBoolE(i interface{}) (bool, error)

ToBoolE casts an interface to a bool type.

func ToDecimalE

func ToDecimalE(v interface{}) (decimal.Decimal, error)

func ToInt16E

func ToInt16E(i interface{}) (int16, error)

ToInt16E casts an interface to an int16 type.

func ToInt32E

func ToInt32E(i interface{}) (int32, error)

ToInt32E casts an interface to an int32 type.

func ToInt64E

func ToInt64E(i interface{}) (int64, error)

ToInt64E casts an interface to an int64 type.

func ToInt8E

func ToInt8E(i interface{}) (int8, error)

ToInt8E casts an interface to an int8 type.

func ToIntE

func ToIntE(i interface{}) (int, error)

ToIntE casts an interface to an int type.

func ToStringE

func ToStringE(i interface{}) (string, error)

ToStringE casts an interface to a string type.

func ToTimeE

func ToTimeE(i interface{}) (tim time.Time, err error)

ToTimeE casts an interface to a time.Time type.

func ToUint16E

func ToUint16E(i interface{}) (uint16, error)

ToUint16E casts an interface to a uint16 type.

func ToUint32E

func ToUint32E(i interface{}) (uint32, error)

ToUint32E casts an interface to a uint32 type.

func ToUint64E

func ToUint64E(i interface{}) (uint64, error)

ToUint64E casts an interface to a uint64 type.

func ToUint8E

func ToUint8E(i interface{}) (uint8, error)

ToUint8E casts an interface to a uint type.

func ToUintE

func ToUintE(i interface{}) (uint, error)

ToUintE casts an interface to a uint type.

Types

type Value

type Value struct {
	reflect.Value
}

func (Value) Add

func (p Value) Add(a Value) (err error)

Jump to

Keyboard shortcuts

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