conv

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 3 Imported by: 8

Documentation

Overview

Example (Convert)
package main

import (
	"fmt"

	"github.com/recallsong/go-utils/conv"
)

func main() {
	var val interface{}
	val = 123
	fmt.Println(conv.ToInt(val, -1))
	fmt.Println(conv.ToInt64(val, -1))
	fmt.Println(conv.ToUint(val, 0))
	fmt.Println(conv.ToUint64(val, 0))
	fmt.Println(conv.ToFloat32(val, -1))
	fmt.Println(conv.ToFloat64(val, -1))
	fmt.Println(conv.ToBool(val, false))
	val = true
	fmt.Println(conv.ToBool(val, false))
	fmt.Println(conv.String(val))

}
Output:

123
123
123
123
123
123
false
true
true
Example (FormatFloat)
package main

import (
	"fmt"

	"github.com/recallsong/go-utils/conv"
)

func main() {
	// conv.CleanFloat("")
	fmt.Println(conv.FormatFloat64(1.25678, 2))
	fmt.Println(conv.FormatFloat64(1.02567, 2))
	fmt.Println(conv.FormatFloat64(1.0000, 2))

}
Output:

1.26
1.03
1
Example (Parse)
package main

import (
	"fmt"

	"github.com/recallsong/go-utils/conv"
)

func main() {
	fmt.Println(conv.ParseInt("100", -1))
	fmt.Println(conv.ParseInt("error", -1))
	fmt.Println(conv.ParseInt8("108", -1))
	fmt.Println(conv.ParseInt16("116", -1))
	fmt.Println(conv.ParseInt32("133", -1))
	fmt.Println(conv.ParseInt64("164", -1))

	fmt.Println(conv.ParseUint("100", 0))
	fmt.Println(conv.ParseUint8("108", 0))
	fmt.Println(conv.ParseUint16("116", 0))
	fmt.Println(conv.ParseUint32("132", 0))
	fmt.Println(conv.ParseUint64("164", 0))

	fmt.Println(conv.ParseFloat32("100.999", -1))
	fmt.Println(conv.ParseFloat64("104.666", -1))

	fmt.Println(conv.ParseBool("true", true))
	fmt.Println(conv.ParseBool("1", true))
	fmt.Println(conv.ParseBool("0", true))
	fmt.Println(conv.ParseBool("False", true))
	fmt.Println(conv.ParseBool("FALSE", true))

}
Output:

100
-1
108
116
133
164
100
108
116
132
164
100.999
104.666
true
true
false
false
false
Example (Slice)
package main

import (
	"fmt"

	"github.com/recallsong/go-utils/conv"
)

func main() {
	is := []int{1, 2, 3, 4, 5}
	var inters []interface{} = conv.Ints(is).ToInterfaces()
	fmt.Println(inters)
	fs := []float32{1, 2, 3, 4, 5}
	var ints []int = conv.Float32s(fs).ToInts()
	fmt.Println(ints)

}
Output:

[1 2 3 4 5]
[1 2 3 4 5]

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v interface{}) (bool, error)

Bool 将interface{}转换为bool

func CleanFloat

func CleanFloat(value string) string

CleanFloat .

func Duration

func Duration(v interface{}) (time.Duration, error)

Duration 将interface{}转换为time.Duration

func Float32

func Float32(v interface{}) (float32, error)

Float32 将interface{}转换为float32

func Float64

func Float64(v interface{}) (float64, error)

Float64 将interface{}转换为float64

func FormatFloat32

func FormatFloat32(value float32, precision int) string

FormatFloat32 .

func FormatFloat64

func FormatFloat64(value float64, precision int) string

FormatFloat64 .

func Int

func Int(v interface{}) (int, error)

Int 将interface{}转换为int

func Int16

func Int16(v interface{}) (int16, error)

Int16 将interface{}转换为int16

func Int32

func Int32(v interface{}) (int32, error)

Int32 将interface{}转换为int32

func Int64

func Int64(v interface{}) (int64, error)

Int64 将interface{}转换为int64

func Int8

func Int8(v interface{}) (int8, error)

Int8 将interface{}转换为int8

func ParseBool

func ParseBool(str string, defVal bool) bool

ParseBool 解析字符串为bool类型的值,失败则返回defVal

func ParseFloat32

func ParseFloat32(str string, defVal float32) float32

ParseFloat32 解析字符串为float32类型的值,失败则返回defVal

func ParseFloat64

func ParseFloat64(str string, defVal float64) float64

ParseFloat64 解析字符串为float64类型的值,失败则返回defVal

func ParseInt

func ParseInt(str string, defVal int) int

ParseInt 解析字符串为int类型的值,失败则返回defVal

func ParseInt16

func ParseInt16(str string, defVal int16) int16

ParseInt16 解析字符串为in16类型的值,失败则返回defVal

func ParseInt32

func ParseInt32(str string, defVal int32) int32

ParseInt32 解析字符串为in32类型的值,失败则返回defVal

func ParseInt64

func ParseInt64(str string, defVal int64) int64

ParseInt64 解析字符串为int64类型的值,失败则返回defVal

func ParseInt8

func ParseInt8(str string, defVal int8) int8

ParseInt8 解析字符串为in8类型的值,失败则返回defVal

func ParseUint

func ParseUint(str string, defVal uint) uint

ParseUint 解析字符串为uint类型的值,失败则返回defVal

func ParseUint16

func ParseUint16(str string, defVal uint16) uint16

ParseUint16 解析字符串为uint16类型的值,失败则返回defVal

func ParseUint32

func ParseUint32(str string, defVal uint32) uint32

ParseUint32 解析字符串为uint32类型的值,失败则返回defVal

func ParseUint64

func ParseUint64(str string, defVal uint64) uint64

ParseUint64 解析字符串为uint64类型的值,失败则返回defVal

func ParseUint8

func ParseUint8(str string, defVal uint8) uint8

ParseUint8 解析字符串为uint8类型的值,失败则返回defVal

func String

func String(v interface{}) string

String 将interface{}转换为string

func ToBool

func ToBool(v interface{}, defVal bool) bool

ToBool 将interface{}转换为bool,失败则返回defVal

func ToDuration

func ToDuration(v interface{}, defVal time.Duration) time.Duration

ToDuration 将interface{}转换为time.Duration,失败则返回defVal

func ToFloat32

func ToFloat32(v interface{}, defVal float32) float32

ToFloat32 将interface{}转换为float32,失败则返回defVal

func ToFloat64

func ToFloat64(v interface{}, defVal float64) float64

ToFloat64 将interface{}转换为float64,失败则返回defVal

func ToInt

func ToInt(v interface{}, defVal int) int

ToInt 将interface{}转换为int,失败则返回defVal

func ToInt16

func ToInt16(v interface{}, defVal int16) int16

ToInt16 将interface{}转换为int16,失败则返回defVal

func ToInt32

func ToInt32(v interface{}, defVal int32) int32

ToInt32 将interface{}转换为int32,失败则返回defVal

func ToInt64

func ToInt64(v interface{}, defVal int64) int64

ToInt64 将interface{}转换为int64,失败则返回defVal

func ToInt8

func ToInt8(v interface{}, defVal int8) int8

ToInt8 将interface{}转换为int8,失败则返回defVal

func ToString

func ToString(v interface{}) string

ToString deprcated ! Use String

func ToUint

func ToUint(v interface{}, defVal uint) uint

ToUint 将interface{}转换为uint,失败则返回defVal

func ToUint16

func ToUint16(v interface{}, defVal uint16) uint16

ToUint16 将interface{}转换为uint16,失败则返回defVal

func ToUint32

func ToUint32(v interface{}, defVal uint32) uint32

ToUint32 将interface{}转换为uint32,失败则返回defVal

func ToUint64

func ToUint64(v interface{}, defVal uint64) uint64

ToUint64 将interface{}转换为uint64,失败则返回defVal

func ToUint8

func ToUint8(v interface{}, defVal uint8) uint8

ToUint8 将interface{}转换为uint8,失败则返回defVal

func Uint

func Uint(v interface{}) (uint, error)

Uint 将interface{}转换为uint

func Uint16

func Uint16(v interface{}) (uint16, error)

Uint16 将interface{}转换为uint16

func Uint32

func Uint32(v interface{}) (uint32, error)

Uint32 将interface{}转换为uint32

func Uint64

func Uint64(v interface{}) (uint64, error)

Uint64 将interface{}转换为uint64

func Uint8

func Uint8(v interface{}) (uint8, error)

Uint8 将interface{}转换为uint8

Types

type Bools

type Bools []bool

Bools 具有类型转换能力的[]bool类型

func (Bools) ToInterfaces

func (s Bools) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

type Complex128s

type Complex128s []complex128

Complex128s 具有类型转换能力的[]complex64类型

func (Complex128s) ToInterfaces

func (s Complex128s) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

type Complex64s

type Complex64s []complex64

Complex64s 具有类型转换能力的[]complex64类型

func (Complex64s) ToInterfaces

func (s Complex64s) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

type Float32s

type Float32s []float32

Float32s 具有类型转换能力的[]float32类型

func (Float32s) ToFloat64s

func (s Float32s) ToFloat64s() []float64

ToFloat64s 转换为[]float64类型

func (Float32s) ToInt16s

func (s Float32s) ToInt16s() []int16

ToInt16s 转换为[]int16类型

func (Float32s) ToInt32s

func (s Float32s) ToInt32s() []int32

ToInt32s 转换为[]int32类型

func (Float32s) ToInt64s

func (s Float32s) ToInt64s() []int64

ToInt64s 转换为[]int64类型

func (Float32s) ToInt8s

func (s Float32s) ToInt8s() []int8

ToInt8s 转换为[]int8类型

func (Float32s) ToInterfaces

func (s Float32s) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

func (Float32s) ToInts

func (s Float32s) ToInts() []int

ToInts 转换为[]int类型

func (Float32s) ToUint16s

func (s Float32s) ToUint16s() []uint16

ToUint16s 转换为[]uint16类型

func (Float32s) ToUint32s

func (s Float32s) ToUint32s() []uint32

ToUint32s 转换为[]uint32类型

func (Float32s) ToUint64s

func (s Float32s) ToUint64s() []uint64

ToUint64s 转换为[]uint64类型

func (Float32s) ToUint8s

func (s Float32s) ToUint8s() []uint8

ToUint8s 转换为[]uint8类型

func (Float32s) ToUints

func (s Float32s) ToUints() []uint

ToUints 转换为[]uint类型

type Float64s

type Float64s []float64

Float64s 具有类型转换能力的[]float64类型

func (Float64s) ToFloat32s

func (s Float64s) ToFloat32s() []float32

ToFloat32s 转换为[]float32类型

func (Float64s) ToInt16s

func (s Float64s) ToInt16s() []int16

ToInt16s 转换为[]int16类型

func (Float64s) ToInt32s

func (s Float64s) ToInt32s() []int32

ToInt32s 转换为[]int32类型

func (Float64s) ToInt64s

func (s Float64s) ToInt64s() []int64

ToInt64s 转换为[]int64类型

func (Float64s) ToInt8s

func (s Float64s) ToInt8s() []int8

ToInt8s 转换为[]int8类型

func (Float64s) ToInterfaces

func (s Float64s) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

func (Float64s) ToInts

func (s Float64s) ToInts() []int

ToInts 转换为[]int类型

func (Float64s) ToUint16s

func (s Float64s) ToUint16s() []uint16

ToUint16s 转换为[]uint16类型

func (Float64s) ToUint32s

func (s Float64s) ToUint32s() []uint32

ToUint32s 转换为[]uint32类型

func (Float64s) ToUint64s

func (s Float64s) ToUint64s() []uint64

ToUint64s 转换为[]uint64类型

func (Float64s) ToUint8s

func (s Float64s) ToUint8s() []uint8

ToUint8s 转换为[]uint8类型

func (Float64s) ToUints

func (s Float64s) ToUints() []uint

ToUints 转换为[]uint类型

type Int16s

type Int16s []int16

Int16s 具有类型转换能力的[]int16类型

func (Int16s) ToFloat32s

func (s Int16s) ToFloat32s() []float32

ToFloat32s 转换为[]float32类型

func (Int16s) ToFloat64s

func (s Int16s) ToFloat64s() []float64

ToFloat64s 转换为[]float64类型

func (Int16s) ToInt32s

func (s Int16s) ToInt32s() []int32

ToInt32s 转换为[]int32类型

func (Int16s) ToInt64s

func (s Int16s) ToInt64s() []int64

ToInt64s 转换为[]int64类型

func (Int16s) ToInt8s

func (s Int16s) ToInt8s() []int8

ToInt8s 转换为[]int8类型

func (Int16s) ToInterfaces

func (s Int16s) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

func (Int16s) ToInts

func (s Int16s) ToInts() []int

ToInts 转换为[]int类型

func (Int16s) ToUint16s

func (s Int16s) ToUint16s() []uint16

ToUint16s 转换为[]uint16类型

func (Int16s) ToUint32s

func (s Int16s) ToUint32s() []uint32

ToUint32s 转换为[]uint32类型

func (Int16s) ToUint64s

func (s Int16s) ToUint64s() []uint64

ToUint64s 转换为[]uint64类型

func (Int16s) ToUint8s

func (s Int16s) ToUint8s() []uint8

ToUint8s 转换为[]uint8类型

func (Int16s) ToUints

func (s Int16s) ToUints() []uint

ToUints 转换为[]uint类型

type Int32s

type Int32s []int32

Int32s 具有类型转换能力的[]int32类型

func (Int32s) ToFloat32s

func (s Int32s) ToFloat32s() []float32

ToFloat32s 转换为[]float32类型

func (Int32s) ToFloat64s

func (s Int32s) ToFloat64s() []float64

ToFloat64s 转换为[]float64类型

func (Int32s) ToInt16s

func (s Int32s) ToInt16s() []int16

ToInt16s 转换为[]int16类型

func (Int32s) ToInt64s

func (s Int32s) ToInt64s() []int64

ToInt64s 转换为[]int64类型

func (Int32s) ToInt8s

func (s Int32s) ToInt8s() []int8

ToInt8s 转换为[]int8类型

func (Int32s) ToInterfaces

func (s Int32s) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

func (Int32s) ToInts

func (s Int32s) ToInts() []int

ToInts 转换为[]int类型

func (Int32s) ToUint16s

func (s Int32s) ToUint16s() []uint16

ToUint16s 转换为[]uint16类型

func (Int32s) ToUint32s

func (s Int32s) ToUint32s() []uint32

ToUint32s 转换为[]uint32类型

func (Int32s) ToUint64s

func (s Int32s) ToUint64s() []uint64

ToUint64s 转换为[]uint64类型

func (Int32s) ToUint8s

func (s Int32s) ToUint8s() []uint8

ToUint8s 转换为[]uint8类型

func (Int32s) ToUints

func (s Int32s) ToUints() []uint

ToUints 转换为[]uint类型

type Int64s

type Int64s []int64

Int64s 具有类型转换能力的[]int64类型

func (Int64s) ToFloat32s

func (s Int64s) ToFloat32s() []float32

ToFloat32s 转换为[]float32类型

func (Int64s) ToFloat64s

func (s Int64s) ToFloat64s() []float64

ToFloat64s 转换为[]float64类型

func (Int64s) ToInt16s

func (s Int64s) ToInt16s() []int16

ToInt16s 转换为[]int16类型

func (Int64s) ToInt32s

func (s Int64s) ToInt32s() []int32

ToInt32s 转换为[]int32类型

func (Int64s) ToInt8s

func (s Int64s) ToInt8s() []int8

ToInt8s 转换为[]int8类型

func (Int64s) ToInterfaces

func (s Int64s) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

func (Int64s) ToInts

func (s Int64s) ToInts() []int

ToInts 转换为[]int类型

func (Int64s) ToUint16s

func (s Int64s) ToUint16s() []uint16

ToUint16s 转换为[]uint16类型

func (Int64s) ToUint32s

func (s Int64s) ToUint32s() []uint32

ToUint32s 转换为[]uint32类型

func (Int64s) ToUint64s

func (s Int64s) ToUint64s() []uint64

ToUint64s 转换为[]uint64类型

func (Int64s) ToUint8s

func (s Int64s) ToUint8s() []uint8

ToUint8s 转换为[]uint8类型

func (Int64s) ToUints

func (s Int64s) ToUints() []uint

ToUints 转换为[]uint类型

type Int8s

type Int8s []int8

Int8s 具有类型转换能力的[]int8类型

func (Int8s) ToFloat32s

func (s Int8s) ToFloat32s() []float32

ToFloat32s 转换为[]float32类型

func (Int8s) ToFloat64s

func (s Int8s) ToFloat64s() []float64

ToFloat64s 转换为[]float64类型

func (Int8s) ToInt16s

func (s Int8s) ToInt16s() []int16

ToInt16s 转换为[]int16类型

func (Int8s) ToInt32s

func (s Int8s) ToInt32s() []int32

ToInt32s 转换为[]int32类型

func (Int8s) ToInt64s

func (s Int8s) ToInt64s() []int64

ToInt64s 转换为[]int64类型

func (Int8s) ToInterfaces

func (s Int8s) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

func (Int8s) ToInts

func (s Int8s) ToInts() []int

ToInts 转换为[]int类型

func (Int8s) ToUint16s

func (s Int8s) ToUint16s() []uint16

ToUint16s 转换为[]uint16类型

func (Int8s) ToUint32s

func (s Int8s) ToUint32s() []uint32

ToUint32s 转换为[]uint32类型

func (Int8s) ToUint64s

func (s Int8s) ToUint64s() []uint64

ToUint64s 转换为[]uint64类型

func (Int8s) ToUint8s

func (s Int8s) ToUint8s() []uint8

ToUint8s 转换为[]uint8类型

func (Int8s) ToUints

func (s Int8s) ToUints() []uint

ToUints 转换为[]uint类型

type Interfaces

type Interfaces []interface{}

func (Interfaces) ToBools

func (s Interfaces) ToBools() []bool

ToBools 转换为[]int类型

func (Interfaces) ToComplex128s

func (s Interfaces) ToComplex128s() []complex128

ToComplex128s 转换为[]int类型

func (Interfaces) ToComplex64s

func (s Interfaces) ToComplex64s() []complex64

ToComplex64s 转换为[]int类型

func (Interfaces) ToFloat32s

func (s Interfaces) ToFloat32s() []float32

ToFloat32s 转换为[]float32类型

func (Interfaces) ToFloat64s

func (s Interfaces) ToFloat64s() []float64

ToFloat64s 转换为[]float64类型

func (Interfaces) ToInt16s

func (s Interfaces) ToInt16s() []int16

ToInt16s 转换为[]int16类型

func (Interfaces) ToInt32s

func (s Interfaces) ToInt32s() []int32

ToInt32s 转换为[]int32类型

func (Interfaces) ToInt64s

func (s Interfaces) ToInt64s() []int64

ToInt64s 转换为[]int64类型

func (Interfaces) ToInt8s

func (s Interfaces) ToInt8s() []int8

ToInt8s 转换为[]int8类型

func (Interfaces) ToInts

func (s Interfaces) ToInts() []int

ToInts 转换为[]int类型

func (Interfaces) ToStrings

func (s Interfaces) ToStrings() []string

ToStrings 转换为[]int类型

func (Interfaces) ToUint16s

func (s Interfaces) ToUint16s() []uint16

ToUint16s 转换为[]uint16类型

func (Interfaces) ToUint32s

func (s Interfaces) ToUint32s() []uint32

ToUint32s 转换为[]uint32类型

func (Interfaces) ToUint64s

func (s Interfaces) ToUint64s() []uint64

ToUint64s 转换为[]uint64类型

func (Interfaces) ToUint8s

func (s Interfaces) ToUint8s() []uint8

ToUint8s 转换为[]uint8类型

func (Interfaces) ToUints

func (s Interfaces) ToUints() []uint

ToUints 转换为[]uint类型

type Ints

type Ints []int

Ints 具有类型转换能力的[]int类型

func (Ints) ToFloat32s

func (s Ints) ToFloat32s() []float32

ToFloat32s 转换为[]float32类型

func (Ints) ToFloat64s

func (s Ints) ToFloat64s() []float64

ToFloat64s 转换为[]float64类型

func (Ints) ToInt16s

func (s Ints) ToInt16s() []int16

ToInt16s 转换为[]int16类型

func (Ints) ToInt32s

func (s Ints) ToInt32s() []int32

ToInt32s 转换为[]int32类型

func (Ints) ToInt64s

func (s Ints) ToInt64s() []int64

ToInt64s 转换为[]int64类型

func (Ints) ToInt8s

func (s Ints) ToInt8s() []int8

ToInt8s 转换为[]int8类型

func (Ints) ToInterfaces

func (s Ints) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

func (Ints) ToUint16s

func (s Ints) ToUint16s() []uint16

ToUint16s 转换为[]uint16类型

func (Ints) ToUint32s

func (s Ints) ToUint32s() []uint32

ToUint32s 转换为[]uint32类型

func (Ints) ToUint64s

func (s Ints) ToUint64s() []uint64

ToUint64s 转换为[]uint64类型

func (Ints) ToUint8s

func (s Ints) ToUint8s() []uint8

ToUint8s 转换为[]uint8类型

func (Ints) ToUints

func (s Ints) ToUints() []uint

ToUints 转换为[]uint类型

type Strings

type Strings []string

Strings 具有类型转换能力的[]string类型

func (Strings) ToInterfaces

func (s Strings) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}

type Uint16s

type Uint16s []uint16

Uint16s 具有类型转换能力的[]uint16类型

func (Uint16s) ToFloat32s

func (s Uint16s) ToFloat32s() []float32

ToFloat32s 转换为[]float32类型

func (Uint16s) ToFloat64s

func (s Uint16s) ToFloat64s() []float64

ToFloat64s 转换为[]float64类型

func (Uint16s) ToInt32s

func (s Uint16s) ToInt32s() []int32

ToInt32s 转换为[]int32类型

func (Uint16s) ToInt64s

func (s Uint16s) ToInt64s() []int64

ToInt64s 转换为[]int64类型

func (Uint16s) ToInt8s

func (s Uint16s) ToInt8s() []int8

ToInt8s 转换为[]int8类型

func (Uint16s) ToInterfaces

func (s Uint16s) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

func (Uint16s) ToInts

func (s Uint16s) ToInts() []int

ToInts 转换为[]int类型

func (Uint16s) ToUint32s

func (s Uint16s) ToUint32s() []uint32

ToUint32s 转换为[]uint32类型

func (Uint16s) ToUint64s

func (s Uint16s) ToUint64s() []uint64

ToUint64s 转换为[]uint64类型

func (Uint16s) ToUint8s

func (s Uint16s) ToUint8s() []uint8

ToUint8s 转换为[]uint8类型

func (Uint16s) ToUints

func (s Uint16s) ToUints() []uint

ToUints 转换为[]uint类型

type Uint32s

type Uint32s []int32

Uint32s 具有类型转换能力的[]uint32类型

func (Uint32s) ToFloat32s

func (s Uint32s) ToFloat32s() []float32

ToFloat32s 转换为[]float32类型

func (Uint32s) ToFloat64s

func (s Uint32s) ToFloat64s() []float64

ToFloat64s 转换为[]float64类型

func (Uint32s) ToInt16s

func (s Uint32s) ToInt16s() []int16

ToInt16s 转换为[]int16类型

func (Uint32s) ToInt32s

func (s Uint32s) ToInt32s() []int32

ToInt32s 转换为[]int32类型

func (Uint32s) ToInt64s

func (s Uint32s) ToInt64s() []int64

ToInt64s 转换为[]int64类型

func (Uint32s) ToInt8s

func (s Uint32s) ToInt8s() []int8

ToInt8s 转换为[]int8类型

func (Uint32s) ToInterfaces

func (s Uint32s) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

func (Uint32s) ToInts

func (s Uint32s) ToInts() []int

ToInts 转换为[]int类型

func (Uint32s) ToUint16s

func (s Uint32s) ToUint16s() []uint16

ToUint16s 转换为[]uint16类型

func (Uint32s) ToUint64s

func (s Uint32s) ToUint64s() []uint64

ToUint64s 转换为[]uint64类型

func (Uint32s) ToUint8s

func (s Uint32s) ToUint8s() []uint8

ToUint8s 转换为[]uint8类型

func (Uint32s) ToUints

func (s Uint32s) ToUints() []uint

ToUints 转换为[]uint类型

type Uint64s

type Uint64s []uint64

Uint64s 具有类型转换能力的[]uint64类型

func (Uint64s) ToFloat32s

func (s Uint64s) ToFloat32s() []float32

ToFloat32s 转换为[]float32类型

func (Uint64s) ToFloat64s

func (s Uint64s) ToFloat64s() []float64

ToFloat64s 转换为[]float64类型

func (Uint64s) ToInt16s

func (s Uint64s) ToInt16s() []int16

ToInt16s 转换为[]int16类型

func (Uint64s) ToInt32s

func (s Uint64s) ToInt32s() []int32

ToInt32s 转换为[]int32类型

func (Uint64s) ToInt64s

func (s Uint64s) ToInt64s() []int64

ToInt64s 转换为[]int64类型

func (Uint64s) ToInt8s

func (s Uint64s) ToInt8s() []int8

ToInt8s 转换为[]int8类型

func (Uint64s) ToInterfaces

func (s Uint64s) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

func (Uint64s) ToInts

func (s Uint64s) ToInts() []int

ToInts 转换为[]int类型

func (Uint64s) ToUint16s

func (s Uint64s) ToUint16s() []uint16

ToUint16s 转换为[]uint16类型

func (Uint64s) ToUint32s

func (s Uint64s) ToUint32s() []uint32

ToUint32s 转换为[]uint32类型

func (Uint64s) ToUint64s

func (s Uint64s) ToUint64s() []uint64

ToUint64s 转换为[]uint64类型

func (Uint64s) ToUint8s

func (s Uint64s) ToUint8s() []uint8

ToUint8s 转换为[]uint8类型

func (Uint64s) ToUints

func (s Uint64s) ToUints() []uint

ToUints 转换为[]uint类型

type Uint8s

type Uint8s []uint8

Uint8s 具有类型转换能力的[]uint8类型

func (Uint8s) ToFloat32s

func (s Uint8s) ToFloat32s() []float32

ToFloat32s 转换为[]float32类型

func (Uint8s) ToFloat64s

func (s Uint8s) ToFloat64s() []float64

ToFloat64s 转换为[]float64类型

func (Uint8s) ToInt16s

func (s Uint8s) ToInt16s() []int16

ToInt16s 转换为[]int16类型

func (Uint8s) ToInt32s

func (s Uint8s) ToInt32s() []int32

ToInt32s 转换为[]int32类型

func (Uint8s) ToInt64s

func (s Uint8s) ToInt64s() []int64

ToInt64s 转换为[]int64类型

func (Uint8s) ToInt8s

func (s Uint8s) ToInt8s() []int8

ToInt8s 转换为[]int8类型

func (Uint8s) ToInterfaces

func (s Uint8s) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

func (Uint8s) ToInts

func (s Uint8s) ToInts() []int

ToInts 转换为[]int类型

func (Uint8s) ToUint16s

func (s Uint8s) ToUint16s() []uint16

ToUint16s 转换为[]uint16类型

func (Uint8s) ToUint32s

func (s Uint8s) ToUint32s() []uint32

ToUint32s 转换为[]uint32类型

func (Uint8s) ToUint64s

func (s Uint8s) ToUint64s() []uint64

ToUint64s 转换为[]uint64类型

func (Uint8s) ToUints

func (s Uint8s) ToUints() []uint

ToUints 转换为[]uint类型

type Uints

type Uints []uint

Uints 具有类型转换能力的[]uint类型

func (Uints) ToFloat32s

func (s Uints) ToFloat32s() []float32

ToFloat32s 转换为[]float32类型

func (Uints) ToFloat64s

func (s Uints) ToFloat64s() []float64

ToFloat64s 转换为[]float64类型

func (Uints) ToInt16s

func (s Uints) ToInt16s() []int16

ToInt16s 转换为[]int16类型

func (Uints) ToInt32s

func (s Uints) ToInt32s() []int32

ToInt32s 转换为[]int32类型

func (Uints) ToInt64s

func (s Uints) ToInt64s() []int64

ToInt64s 转换为[]int64类型

func (Uints) ToInt8s

func (s Uints) ToInt8s() []int8

ToInt8s 转换为[]int8类型

func (Uints) ToInterfaces

func (s Uints) ToInterfaces() []interface{}

ToInterfaces 转换为[]interface{}类型

func (Uints) ToInts

func (s Uints) ToInts() []int

ToInts 转换为[]int类型

func (Uints) ToUint16s

func (s Uints) ToUint16s() []uint16

ToUint16s 转换为[]uint16类型

func (Uints) ToUint32s

func (s Uints) ToUint32s() []uint32

ToUint32s 转换为[]uint32类型

func (Uints) ToUint64s

func (s Uints) ToUint64s() []uint64

ToUint64s 转换为[]uint64类型

func (Uints) ToUint8s

func (s Uints) ToUint8s() []uint8

ToUint8s 转换为[]uint8类型

Jump to

Keyboard shortcuts

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