Go第三方庫structs
庫第三方庫
see https://github.com/fatih/structs
範例:拿到結構裡面的欄位名
type A struct {
Foo string
Bar int
}
func main() {
names := structs.Names(&A{})
fmt.Println(names) // ["Foo", "Bar"]
}
ref
Note
Last updated
庫第三方庫
see https://github.com/fatih/structs
type A struct {
Foo string
Bar int
}
func main() {
names := structs.Names(&A{})
fmt.Println(names) // ["Foo", "Bar"]
}
Last updated