types

package
v0.3.82 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: LGPL-2.1 Imports: 6 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool2Int

func Bool2Int[T constraints.Integer](b bool) T

Bool2Int bool转int

func Bytes2String

func Bytes2String(b []byte) string

Bytes2String 快速bytes转string

func FullName

func FullName(i any) string

FullName 类型全名

func FullNameRT

func FullNameRT(t reflect.Type) string

FullNameRT 类型全名

func FullNameT

func FullNameT[T any]() string

FullNameT 类型全名

func Int2Bool

func Int2Bool[T constraints.Integer](v T) bool

Int2Bool int转bool

func Name

func Name(i any) string

Name 类型名

func NameRT

func NameRT(t reflect.Type) string

NameRT 类型名

func NameT

func NameT[T any]() string

NameT 类型名

func New added in v0.3.65

func New(t any) reflect.Value

New 新建零值

func NewCopied added in v0.3.65

func NewCopied(src any) reflect.Value

NewCopied 新建拷贝值

func NewCopiedRT added in v0.3.65

func NewCopiedRT(src reflect.Value) reflect.Value

NewCopiedRT 新建拷贝值

func NewCopiedT

func NewCopiedT[T any](src T) *T

NewCopiedT 新建拷贝值

func NewRT added in v0.3.65

func NewRT(t reflect.Type) reflect.Value

NewRT 新建零值

func NewT

func NewT[T any]() *T

NewT 新建零值

func Panic2Err

func Panic2Err(panicInfo any) error

Panic2Err panic转换为error

func String2Bytes

func String2Bytes(s string) []byte

String2Bytes 快速string转bytes

func WriteFullName added in v0.3.65

func WriteFullName(sb *strings.Builder, i any)

WriteFullName 写入类型全名

func WriteFullNameRT

func WriteFullNameRT(sb *strings.Builder, t reflect.Type)

WriteFullNameRT 写入类型全名

func WriteFullNameT

func WriteFullNameT[T any](sb *strings.Builder)

WriteFullNameT 写入类型全名

func Zero added in v0.3.65

func Zero(t any) reflect.Value

Zero 创建零值

func ZeroRT added in v0.3.65

func ZeroRT(t reflect.Type) reflect.Value

ZeroRT 创建零值

func ZeroT

func ZeroT[T any]() T

ZeroT 创建零值

Types

type Bits16 added in v0.3.80

type Bits16 uint16

func (*Bits16) Is added in v0.3.80

func (bits *Bits16) Is(bit int8) bool

func (*Bits16) Set added in v0.3.80

func (bits *Bits16) Set(bit int8, b bool)

type Bits32 added in v0.3.80

type Bits32 uint8

func (*Bits32) Is added in v0.3.80

func (bits *Bits32) Is(bit int8) bool

func (*Bits32) Set added in v0.3.80

func (bits *Bits32) Set(bit int8, b bool)

type Bits64 added in v0.3.80

type Bits64 uint8

func (*Bits64) Is added in v0.3.80

func (bits *Bits64) Is(bit int8) bool

func (*Bits64) Set added in v0.3.80

func (bits *Bits64) Set(bit int8, b bool)

type Bits8 added in v0.3.80

type Bits8 uint8

func (*Bits8) Is added in v0.3.80

func (bits *Bits8) Is(bit int8) bool

func (*Bits8) Set added in v0.3.80

func (bits *Bits8) Set(bit int8, b bool)

Jump to

Keyboard shortcuts

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