convert

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// StructTagPriority defines the default priority tags for Map*/Struct* functions.
	// Note that, the `gconv/param` tags are used by old version of package.
	// It is strongly recommended using short tag `c/p` instead in the future.
	StructTagPriority = tag.StructTagPriority
)

Functions

func Any

func Any(value interface{}) *any

func Bool

func Bool(any interface{}) bool

Bool converts `any` to bool. It returns false if `any` is: false, "", 0, "false", "off", "no", empty slice/map.

func Byte

func Byte(any interface{}) byte

Byte converts `any` to byte.

func Bytes

func Bytes(any interface{}) []byte

Bytes converts `any` to []byte.

func Float32

func Float32(any interface{}) float32

Float32 converts `any` to float32.

func Float64

func Float64(any interface{}) float64

Float64 converts `any` to float64.

func Int

func Int(any interface{}) int

Int converts `any` to int.

func Int16

func Int16(any interface{}) int16

Int16 converts `any` to int16.

func Int32

func Int32(any interface{}) int32

Int32 converts `any` to int32.

func Int32s

func Int32s(any interface{}) []int32

Int32s converts `any` to []int32.

func Int64

func Int64(any interface{}) int64

Int64 converts `any` to int64.

func Int64s

func Int64s(any interface{}) []int64

Int64s converts `any` to []int64.

func Int8

func Int8(any interface{}) int8

Int8 converts `any` to int8.

func Interfaces

func Interfaces(any interface{}) []interface{}

Interfaces converts `any` to []interface{}.

func Ints

func Ints(any interface{}) []int

Ints converts `any` to []int.

func Map

func Map(value interface{}, tags ...string) map[string]interface{}

func Rune

func Rune(any interface{}) rune

Rune converts `any` to rune.

func Runes

func Runes(any interface{}) []rune

Runes converts `any` to []rune.

func SliceAny

func SliceAny(any interface{}) []interface{}

SliceAny is alias of Interfaces.

func SliceInt

func SliceInt(any interface{}) []int

SliceInt is alias of Ints.

func SliceInt32

func SliceInt32(any interface{}) []int32

SliceInt32 is alias of Int32s.

func SliceInt64

func SliceInt64(any interface{}) []int64

SliceInt64 is alias of Int64s.

func SliceStr

func SliceStr(any interface{}) []string

SliceStr is alias of Strings.

func String

func String(any interface{}) string

func Strings

func Strings(any interface{}) []string

Strings converts `any` to []string.

func Time

func Time(any interface{}, format ...string) time.Time

Time converts `any` to time.Time.

func Uint

func Uint(any interface{}) uint

Uint converts `any` to uint.

func Uint16

func Uint16(any interface{}) uint16

Uint16 converts `any` to uint16.

func Uint32

func Uint32(any interface{}) uint32

Uint32 converts `any` to uint32.

func Uint64

func Uint64(any interface{}) uint64

Uint64 converts `any` to uint64.

func Uint8

func Uint8(any interface{}) uint8

Uint8 converts `any` to uint8.

Types

This section is empty.

Jump to

Keyboard shortcuts

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