mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-03 14:59:38 +08:00
feat: generate html reports for API testing #74
This commit is contained in:
@@ -137,8 +137,12 @@ func formatValue(raw interface{}) interface{} {
|
|||||||
case reflect.Map:
|
case reflect.Map:
|
||||||
m := make(map[string]interface{})
|
m := make(map[string]interface{})
|
||||||
for key, value := range rawValue.Interface().(map[string]interface{}) {
|
for key, value := range rawValue.Interface().(map[string]interface{}) {
|
||||||
b, _ := json.MarshalIndent(&value, "", " ")
|
fmtValue, ok := value.(string)
|
||||||
m[key] = string(b)
|
if !ok {
|
||||||
|
b, _ := json.MarshalIndent(&value, "", " ")
|
||||||
|
fmtValue = string(b)
|
||||||
|
}
|
||||||
|
m[key] = fmtValue
|
||||||
}
|
}
|
||||||
return m
|
return m
|
||||||
case reflect.Slice:
|
case reflect.Slice:
|
||||||
|
|||||||
Reference in New Issue
Block a user