mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +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:
|
||||
m := make(map[string]interface{})
|
||||
for key, value := range rawValue.Interface().(map[string]interface{}) {
|
||||
b, _ := json.MarshalIndent(&value, "", " ")
|
||||
m[key] = string(b)
|
||||
fmtValue, ok := value.(string)
|
||||
if !ok {
|
||||
b, _ := json.MarshalIndent(&value, "", " ")
|
||||
fmtValue = string(b)
|
||||
}
|
||||
m[key] = fmtValue
|
||||
}
|
||||
return m
|
||||
case reflect.Slice:
|
||||
|
||||
Reference in New Issue
Block a user