(jsonStr string, typeName string)
| 23 | ) |
| 24 | |
| 25 | func parseJSONArray(jsonStr string, typeName string) ([]map[string]interface{}, error) { |
| 26 | var list []map[string]interface{} |
| 27 | if err := json.Unmarshal([]byte(jsonStr), &list); err != nil { |
| 28 | return nil, fmt.Errorf("%s格式错误:%s", typeName, err.Error()) |
| 29 | } |
| 30 | return list, nil |
| 31 | } |
| 32 | |
| 33 | func validateURL(urlStr string, index int, itemType string) error { |
| 34 | if !urlRegex.MatchString(urlStr) { |
no test coverage detected