mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-19 03:05:53 +08:00
make json data printable
This commit is contained in:
parent
3839f96b44
commit
c98d65dcdb
@ -1,6 +1,7 @@
|
||||
package asynqmon
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
@ -226,6 +227,9 @@ func isPrintable(data []byte) bool {
|
||||
if !utf8.Valid(data) {
|
||||
return false
|
||||
}
|
||||
if json.Valid(data) {
|
||||
return true
|
||||
}
|
||||
isAllSpace := true
|
||||
for _, r := range string(data) {
|
||||
if !unicode.IsPrint(r) {
|
||||
|
Loading…
Reference in New Issue
Block a user