(s *schema.Schema, rawResult interface{})
| 28 | var errorKey = "error" |
| 29 | |
| 30 | func (gohanClientCLI *GohanClientCLI) formatOutput(s *schema.Schema, rawResult interface{}) string { |
| 31 | if rawResult == nil { |
| 32 | return "" |
| 33 | } |
| 34 | switch gohanClientCLI.opts.outputFormat { |
| 35 | case outputFormatTable: |
| 36 | return gohanClientCLI.formatOutputTable(s, rawResult) |
| 37 | default: |
| 38 | result, _ := json.MarshalIndent(rawResult, "", "\t") |
| 39 | return fmt.Sprintf("%s", result) |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | func (gohanClientCLI *GohanClientCLI) formatOutputTable(s *schema.Schema, rawResult interface{}) string { |
| 44 | buffer := bytes.NewBufferString("") |
no test coverage detected