mirror of
https://gitea.com/gitea/tea.git
synced 2025-09-01 09:28:30 +02:00
improve
This commit is contained in:
@ -177,9 +177,14 @@ func outputJSON(f io.Writer, headers []string, values [][]string) {
|
||||
for j, val := range value {
|
||||
v, err := json.Marshal(val)
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to format JSON for value '%s': %v\n", val, err)
|
||||
return
|
||||
}
|
||||
key, err := json.Marshal(toSnakeCase(headers[j]))
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to format JSON for header '%s': %v\n", headers[j], err)
|
||||
return
|
||||
}
|
||||
key, _ := json.Marshal(toSnakeCase(headers[j]))
|
||||
fmt.Fprintf(f, "%s:%s", key, v)
|
||||
if j != headersCount-1 {
|
||||
fmt.Fprintln(f, ",")
|
||||
|
Reference in New Issue
Block a user