- 使用 json.MarshalIndent替代 json.Marshal - 添加缩进空格,提高 JSON 数据的可读性
@@ -50,7 +50,7 @@ func (service *formatterService) FormatBackendData(ctx context.Context, req *v1.
if err != nil {
return "", 0, err
}
- jsonBytes, err := json.Marshal(sortedOutput)
+ jsonBytes, err := json.MarshalIndent(sortedOutput, "", " ")