Skip to main content

cvt

github.com

cvt是一个简单、安全、高效的Go语言工具包,用于任意数据类型的安全转换。支持自定义类型、指针类型、默认值设置,并提供丰富的API覆盖基本数据类型转换。具有99%的测试覆盖率,确保稳定可靠。

Developer Tools & APIsOpen source#go-library#data-conversion#type-safety
Visit website
cvt preview

cvt一个简单、安全、高效的转换任意数据类型的 Go 语言工具包,支持自定义类型、提取结构体字段和值GitHub: 安装## 使用### 支持 > 以 结尾的方法 : 当转换失败时会返回错误### 自定义类型、指针类型> 自动解引用,并找到基本类型,完全支持自定义类型的转换### 忽略 > 名称不以 结尾的方法,如果转换失败,不会返回错误,会返回零值### 默认值> 如果转换失败,返回默认值### 更多示例> 超过1000个单元测试用例,覆盖率99%,所有示例可通过单元测试了解:## API### bool- Bool / BoolE### int- Int / IntE- Int8 / Int8E- Int16 / Int16E- Int32 / Int32E- Int64 / Int64E- Uint / UintE- Uint8 / Uint8E- Uint16 / Uint16E- Uint32 / Uint32E- Uint64 / Uint64E### string- String / StringE### float- Float32 / Float32E- Float64 / Float64E### time- Time / TimeE### slice- : 类似于 PHP 中的 , 函数的切片版本,返回 - : 取 或 的字段值,返回 - : 取 的键名,返回 - / : 转换成 - : 转换成 - : 转换成 - : 转换成 - : 转换成

More in Developer Tools & APIs

SolveHub

API for CAPTCHA and anti-bot tasks in authorized testing

Dev Tools ·

liarjs.dev

Scanner that cross-checks browser JavaScript fingerprint against network layer

Dev Tools ·

AntiBrow

Antidetect browser for managing multiple browser identities with real-device

Dev Tools ·

HostlessWP

Open source CLI to move WordPress to Cloudflare Workers

Dev Tools ·

deed.page

Permanent web hosting with an API for AI agents

Dev Tools ·

Rowflare

Open-source Airtable alternative running on your Cloudflare account

Dev Tools ·