(s string)
| 272 | } |
| 273 | |
| 274 | func parseListOfStringLists(s string) ([][]string, error) { |
| 275 | ll, err := structuredheader.ParseListOfLists(s) |
| 276 | if err != nil { |
| 277 | return nil, err |
| 278 | } |
| 279 | // Convert [][]structuredheader.Item to [][]string. |
| 280 | var result [][]string |
| 281 | for _, l := range ll { |
| 282 | var sl []string |
| 283 | for _, item := range l { |
| 284 | switch v := item.(type) { |
| 285 | case string: |
| 286 | sl = append(sl, v) |
| 287 | case structuredheader.Token: |
| 288 | sl = append(sl, string(v)) |
| 289 | default: |
| 290 | return nil, fmt.Errorf("unexpected value of type %T", v) |
| 291 | } |
| 292 | } |
| 293 | result = append(result, sl) |
| 294 | } |
| 295 | return result, nil |
| 296 | } |
| 297 | |
| 298 | // Variants represents a Variants: header value. |
| 299 | type Variants [][]string |
no test coverage detected