JSON outputs data as formatted JSON.
(data interface{})
| 17 | |
| 18 | // JSON outputs data as formatted JSON. |
| 19 | func JSON(data interface{}) error { |
| 20 | out, err := json.MarshalIndent(data, "", " ") |
| 21 | if err != nil { |
| 22 | return err |
| 23 | } |
| 24 | fmt.Println(string(out)) |
| 25 | return nil |
| 26 | } |
| 27 | |
| 28 | // Title prints a styled title. |
| 29 | func Title(icon, text string) { |
no outgoing calls
no test coverage detected