(status interface{})
| 101 | } |
| 102 | |
| 103 | func ToJSONString(status interface{}) string { |
| 104 | buf := new(bytes.Buffer) |
| 105 | err := json.NewEncoder(buf).Encode(status) |
| 106 | if err != nil { |
| 107 | panic(err) |
| 108 | } |
| 109 | return buf.String() |
| 110 | } |
| 111 | |
| 112 | // DisplayWidth returns the number of terminal cells needed to display s |
| 113 | func DisplayWidth(s string) int { |