(list *ast.List, sep string)
| 7 | ) |
| 8 | |
| 9 | func Join(list *ast.List, sep string) string { |
| 10 | if list == nil { |
| 11 | return "" |
| 12 | } |
| 13 | |
| 14 | var items []string |
| 15 | for _, item := range list.Items { |
| 16 | if n, ok := item.(*ast.String); ok { |
| 17 | items = append(items, n.Str) |
| 18 | } |
| 19 | } |
| 20 | return strings.Join(items, sep) |
| 21 | } |