mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-02-23 20:30:12 +08:00
Fix isPrintable helper
This commit is contained in:
parent
d58d549d4c
commit
403062b556
@ -171,12 +171,16 @@ func isPrintable(data []byte) bool {
|
|||||||
if !utf8.Valid(data) {
|
if !utf8.Valid(data) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
isAllSpace := true
|
||||||
for _, r := range string(data) {
|
for _, r := range string(data) {
|
||||||
if !unicode.IsPrint(r) {
|
if !unicode.IsPrint(r) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if !unicode.IsSpace(r) {
|
||||||
|
isAllSpace = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true
|
return !isAllSpace
|
||||||
}
|
}
|
||||||
|
|
||||||
func toPrintablePayload(payload []byte) string {
|
func toPrintablePayload(payload []byte) string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user