(strs traits.Lister, separator string)
| 799 | } |
| 800 | |
| 801 | func joinValSeparator(strs traits.Lister, separator string) (string, error) { |
| 802 | sz := strs.Size().(types.Int) |
| 803 | var sb strings.Builder |
| 804 | for i := types.Int(0); i < sz; i++ { |
| 805 | if i != 0 { |
| 806 | sb.WriteString(separator) |
| 807 | } |
| 808 | elem := strs.Get(i) |
| 809 | str, ok := elem.(types.String) |
| 810 | if !ok { |
| 811 | return "", fmt.Errorf("join: invalid input: %v", elem) |
| 812 | } |
| 813 | sb.WriteString(string(str)) |
| 814 | } |
| 815 | return sb.String(), nil |
| 816 | } |
| 817 | |
| 818 | // quote implements a string quoting function. The string will be wrapped in |
| 819 | // double quotes, and all valid CEL escape sequences will be escaped to show up |
no test coverage detected