package
1.1.3
Repository: https://github.com/go-spring/spring-base.git
Documentation: pkg.go.dev

# README

cast

Provides many conversion functions between types.

Install

go get github.com/go-spring/[email protected] 

Import

import "github.com/go-spring/spring-base/cast"

Example

fmt.Println(cast.ToInt(10))   // 10
fmt.Println(cast.ToInt(10.0)) // 10
fmt.Println(cast.ToInt("10")) // 10
fmt.Println(cast.ToInt(true)) // 1

# Functions

No description provided by the author
BytesToString converts byte slice to string without memory allocation.
No description provided by the author
No description provided by the author
HexDigitToInt converts a hex digit into an int.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IsHexDigit returns whether the character is a valid hexadecimal character.
No description provided by the author
StringToBytes converts string to byte slice without memory allocation.
ToBool casts an interface{} to a bool.
ToBoolE casts an interface{} to a bool.
ToDuration casts an interface{} to a time.Duration.
ToDurationE casts an interface{} to a time.Duration.
ToFloat32 casts an interface{} to a float32.
ToFloat64 casts an interface{} to a float64.
ToFloat64E casts an interface{} to a float64.
ToInt casts an interface{} to an int.
ToInt16 casts an interface{} to an int16.
ToInt32 casts an interface{} to an int32.
ToInt64 casts an interface{} to an int64.
ToInt64E casts an interface{} to an int64.
ToInt8 casts an interface{} to an int8.
ToString casts an interface{} to a string.
ToStringE casts an interface{} to a string.
ToTime casts an interface{} to a time.Time.
ToTimeE casts an interface{} to a time.Time.
ToUint casts an interface{} to an uint.
ToUint16 casts an interface{} to an uint16.
ToUint32 casts an interface{} to an uint32.
ToUint64 casts an interface{} to an uint64.
ToUint64E casts an interface{} to an uint64.
ToUint8 casts an interface{} to an uint8.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author

# Structs

No description provided by the author