LongBytesGoString returns a string representation of the byte slice shortened using the format ' { ... ( bytes)}' if it exceeds a predetermined length. Can be used to avoid filling the display with very long byte strings.
(buf []byte)
| 321 | // exceeds a predetermined length. Can be used to avoid filling the display with |
| 322 | // very long byte strings. |
| 323 | func LongBytesGoString(buf []byte) string { |
| 324 | if len(buf) < longBytesLength { |
| 325 | return fmt.Sprintf("%#v", buf) |
| 326 | } |
| 327 | s := fmt.Sprintf("%#v", buf[:longBytesLength-1]) |
| 328 | s = strings.TrimSuffix(s, "}") |
| 329 | return fmt.Sprintf("%s ... (%d bytes)}", s, len(buf)) |
| 330 | } |
| 331 | |
| 332 | func baseLayerString(value reflect.Value) string { |
| 333 | t := value.Type() |
no outgoing calls
searching dependent graphs…