typeconvert

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToInt64

func BytesToInt64(bys []byte) int64

func BytesToString

func BytesToString(b *[]byte) *string

BytesToString convert bytes to string

func Float64ToString

func Float64ToString(a float64) string

Float64ToString : float64 -> string

func Int16ToString

func Int16ToString(a int16) string

Int16ToString : int16 -> string

func Int32ToString

func Int32ToString(a int32) string

Int32ToString : int32 -> string

func Int64ToBytes

func Int64ToBytes(n int64) []byte

func Int64ToString

func Int64ToString(a int64) string

Int64ToString : int64 -> string

func IntToString

func IntToString(a int) string

IntToString : int -> string

func StringToBool

func StringToBool(s string) bool

StringToBool : string -> bool

func StringToFloat64

func StringToFloat64(s string) float64

StringToFloat64 : string -> float64

func StringToInt

func StringToInt(s string, optionalNum ...int) int

StringToInt : string -> int

func StringToInt16

func StringToInt16(s string) int16

StringToInt16 : string -> int16

func StringToInt32

func StringToInt32(s string) int32

StringToInt32 : string -> int32

func StringToInt32Slice

func StringToInt32Slice(s string, sep string) (ret []int32)

StringToInt32Slice :

func StringToInt64

func StringToInt64(s string) int64

StringToInt64 : string -> int64

func StringToUint

func StringToUint(s string) uint

StringToUint : string -> uint

func StringToUint16

func StringToUint16(s string) uint16

StringToUint16 : string -> uint16

func StringToUint32

func StringToUint32(s string) uint32

StringToUint32 : string -> uint32

func StringToUint64

func StringToUint64(s string) uint64

StringToUint64 : string -> uint64

func ToString

func ToString(v interface{}) string

ToString convert some type to string []string{"a","b"} => "a,b" []int{1,2} => "1,2" []string{} => ""

func ToStringSlice

func ToStringSlice(v interface{}) []string

ToStringSlice ToStringSlice

func ToStringSliceWithSort

func ToStringSliceWithSort(v any) []string

ToStringSliceWithSort converts elements into the string and provides a sorted slice.

func ToStringWithSort

func ToStringWithSort(v any) string

ToStringWithSort converts some type to string with sort by acs []string{"b", "c", "a"} => "a,b,c" []int{1, 3, 2} => "1,2,3" []int64{21, 34, 29, 17, 33} => "17,21,29,33,34" []float64{3.14, 3.15, 3.02, 2.98} => "2.98,3.02,3.14,3.15" If `v` is `[]string`, the original slice will not be modified because of deep copy in this function.

func Uint16ToString

func Uint16ToString(a uint16) string

Uint16ToString : uint16 -> string

func Uint32ToString

func Uint32ToString(a uint32) string

Uint32ToString : uint32 -> string

func Uint64SliceToInterfaceSlice

func Uint64SliceToInterfaceSlice(a []uint64) []interface{}

Uint64SliceToInterfaceSlice : []uint64 -> []interface{}

func Uint64ToString

func Uint64ToString(a uint64) string

Uint64ToString : uint64 -> string

Types

This section is empty.

Jump to

Keyboard shortcuts

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