Sora Watermark Remover - Allows you to remove the watermark from Sora videos.Try Now

CurateClick

github.com favicon

cvt

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

Check out cvt on CurateClick

• Copy the embed code to showcase this product on your website

• Share on X to spread the word about this amazing tool

cvt一个简单、安全、高效的转换任意数据类型的 Go 语言工具包,支持自定义类型、提取结构体字段和值GitHub: https://github.com/shockerli/cvt## 安装gogo get -u github.com/shockerli/cvt## 使用### 支持 error> 以 E 结尾的方法 __E(): 当转换失败时会返回错误gocvt.IntE("12") // 12, nilcvt.Float64E("12.34") // 12.34, nilcvt.StringE(12.34) // "12.34", nilcvt.BoolE("false") // false, nil### 自定义类型、指针类型> 自动解引用,并找到基本类型,完全支持自定义类型的转换gotype Name stringvar name Name = "jioby"cvt.StringE(name) // jioby, nilcvt.StringE(&name) // jioby, nil### 忽略 error> 名称不以 E 结尾的方法,如果转换失败,不会返回错误,会返回零值gocvt.Int("12") // 12(success)cvt.Int(struct{}{}) // 0(failed)### 默认值> 如果转换失败,返回默认值gocvt.Int(struct{}{}, 12) // 12cvt.Float("hello", 12.34) // 12.34### 更多示例> 超过1000个单元测试用例,覆盖率99%,所有示例可通过单元测试了解:*_test.go## 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- ColumnsE: 类似于 PHP 中的 array_columnFieldE 函数的切片版本,返回 []interface{}- FieldE: 取 mapstruct 的字段值,返回 interface{}- KeysE: 取 map 的键名,返回 []interface{}- Slice / SliceE: 转换成 []interface{}- SliceIntE: 转换成 []int- SliceInt64E: 转换成 []int64- SliceFloat64E: 转换成 []float64- SliceStringE: 转换成 []string

Latest Weekly Picks

seedance2.ai favicon
Weekly Pick

Seedance 2 Delivers High Fidelity Motion and Audio Sync

Seedance 2
nanobananaimg.com favicon
Weekly Pick

Nano Banana AI Image Generator for Professional Image Creation with Nano Banana Pro Models

Nano Banana
pslscale.com favicon
Weekly Pick

使用 Gemini 3 Pro 分析八字命理

人生 K 线
seedance15.ai favicon
Weekly Pick

Create Cinematic AI Videos from Text or Images with Seedance 1.5

Seedance 1.5 AI
tatted.ai favicon
Weekly Pick

The Tatted AI Tattoo Generator is a tool that allows you to create beautiful custom tattoos within seconds.

Tatted
pslscale.com favicon
Weekly Pick

Discover your PSL (Perceived Sexual Market Value) score with our AI-powered facial analysis

PSL Scale

IPYNB to PDF Converter – Free & Secure

www.reverie.im favicon
Weekly Pick

Dream It, Chat It, Create It

Reverie