package main
type SumIndustryLabel struct {
Id string `json:"id" `
Label string `json:"label" `
Children []SumIndustryLabel `json:"children" `
}
func main() {
var list []dto.SumIndustryLabel
traversingSumIndustryLabel(list)
}
func traversingSumIndustryLabel(list []dto.SumIndustryLabel) {
for item := range list{
var temp []dto.SumIndustryLabel
if len(list[item].Children) <= 0 {
fmt.Println(list[item].Label)
}else {
fmt.Println(list[item].Label)
temp = list[item].Children
e.traversingSumIndustryLabel(temp)
}
}
}