Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListToTree ¶
func ListToTree[L ListItem[T, S, L], T comparable, S TreeNode[L, S]](src []L) []S
ListToTree 列表转树
Types ¶
type ListItem ¶
type ListItem[T comparable, S TreeNode[M, S], M any] interface { GetID() T // 获取 ID GetParentID() T // 获取父 ID }
ListItem 列表项接口 T 用于接收数据源的唯一标识,需要可比较 S 是需要转换的目标数据结构 M 是ListItem数据源本身
Click to show internal directories.
Click to hide internal directories.