Pretty will attempt to convert any Go structure into a string suitable for logging.
(input any)
| 8 | |
| 9 | // Pretty will attempt to convert any Go structure into a string suitable for logging. |
| 10 | func Pretty(input any) string { |
| 11 | pretty, err := json.MarshalIndent(input, "\t", "\t") |
| 12 | if err != nil { |
| 13 | return fmt.Sprintf("%v", input) |
| 14 | } |
| 15 | |
| 16 | return fmt.Sprintf("\n\t%s", pretty) |
| 17 | } |
| 18 | |
| 19 | // GetStack will convert the Go stack into a string suitable for logging. |
| 20 | func GetStack() string { |
no outgoing calls
no test coverage detected
searching dependent graphs…