go 父子集组装成树形结构体
import ( "encoding/json" "fmt")type Row struct { Id int ParentId int Name string}type Node struct { *Row Children []*Node `json:"children,omitempty"`}func generateTree(rows []*Row) []*Node { idMap := make(map[int]*Node, len(rows.