api

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IGNORE_FLOAT = true
)

Variables

View Source
var (
	ErrInvalidCopyDestination = errors.New("copy destination is invalid")
	ErrInvalidCopyFrom        = errors.New("copy from is invalid")
	ErrMapKeyNotMatch         = errors.New("map's key type doesn't match")
	ErrNotSupported           = errors.New("not supported")
)

Functions

func Bytes2String added in v1.2.6

func Bytes2String(b []byte) string

Bytes2String 字节数组转字符串

func ChanIsClosed added in v1.3.3

func ChanIsClosed(ch any) bool

ChanIsClosed 判断channel是否关闭

func CloseQuietly

func CloseQuietly(closer io.Closer)

CloseQuietly 关闭io, 忽略错误

func Convert added in v1.1.17

func Convert(data []string, v interface{}) error

func Copy added in v1.1.9

func Copy(toValue interface{}, fromValue interface{}) (err error)

Copy copy things

func CopyWithOption added in v1.1.9

func CopyWithOption(toValue interface{}, fromValue interface{}, opt Option) (err error)

CopyWithOption copy with option

func KebabCase added in v1.1.21

func KebabCase(s string) string

KebabCase converts a string into kebab case.

func LowerCamelCase added in v1.1.21

func LowerCamelCase(s string) string

LowerCamelCase converts a string into camel case starting with a lower case letter.

func ParseFloat

func ParseFloat(s string) float64

func ParseInt added in v1.1.5

func ParseInt(s string) int64

func ParseUint

func ParseUint(s string) uint64

func Reverse added in v1.1.17

func Reverse(slice interface{}) interface{}

Reverse 反转切片

func SnakeCase added in v1.1.21

func SnakeCase(s string) string

SnakeCase converts a string into snake case.

func String2Bytes added in v1.2.6

func String2Bytes(s string) []byte

String2Bytes 字符串转字节数组

func ToCamelCase added in v1.1.21

func ToCamelCase(kebab string) (camelCase string)

ToCamelCase 转驼峰

func ToString

func ToString(value interface{}) string

ToString converts a value to string.

func UpperCamelCase added in v1.1.21

func UpperCamelCase(s string) string

UpperCamelCase converts a string into camel case starting with a upper case letter.

func UpperKebabCase added in v1.1.21

func UpperKebabCase(s string) string

UpperKebabCase converts a string into kebab case with capital letters.

func UpperSnakeCase added in v1.1.21

func UpperSnakeCase(s string) string

UpperSnakeCase converts a string into snake case with capital letters.

Types

type Option added in v1.1.9

type Option struct {
	// setting this value to true will ignore copying zero values of all the fields, including bools, as well as a
	// struct having all it's fields set to their zero values respectively (see IsZero() in reflect/value.go)
	IgnoreEmpty bool
	DeepCopy    bool
}

Option sets copy options

Jump to

Keyboard shortcuts

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