gostruct:Go的运行时结构构建器

时间:2024-03-23 21:34:29
【文件属性】:

文件名称:gostruct:Go的运行时结构构建器

文件大小:14KB

文件格式:ZIP

更新时间:2024-03-23 21:34:29

golang reflection Go

gostruct Go的运行时结构生成器 例子 func Example () { person := gostruct . New (). AddString ( "Name" ). AddInt64 ( "Age" ). Build () p := person . New () p . SetString ( "Name" , "gopher" ) p . SetInt64 ( "Age" , 11 ) fmt . Printf ( " %T: %+v \n " , p . Interface (), p . Interface ()) fmt . Printf ( "%T: %+v \n " , p . Addr (), p . Addr ()) // Output: // struct { Name string; Age int64 }: {


【文件预览】:
gostruct-main
----LICENSE(34KB)
----builder.go(2KB)
----.gitignore(269B)
----Makefile(79B)
----builder_test.go(485B)
----README.md(476B)

网友评论