conv

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(b []byte) string

func PtrValue added in v1.5.7

func PtrValue[T any](v *T) (t T)

PtrValue 返回指针指向的值,指针为 nil 时返回类型零值。

func StringToBytes

func StringToBytes(s string) []byte

func To added in v1.5.6

func To[T cast.Basic](v any) T

To 将任意值弱类型转换为目标基础类型,转换失败时返回类型零值而非错误。

func ToE added in v1.5.6

func ToE[T cast.Basic](v any) (T, error)

ToE 将任意值弱类型转换为目标基础类型,转换失败时返回错误和类型零值。

Types

This section is empty.

Jump to

Keyboard shortcuts

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