(stdout, stderr *bytes.Buffer)
| 33 | func (r *failingReadCloser) Close() error { return nil } |
| 34 | |
| 35 | func testGetJSONCmd(stdout, stderr *bytes.Buffer) *cobra.Command { |
| 36 | cmd := testGetCmd() |
| 37 | cmd.Flags().String(outputFlag, "text", "") |
| 38 | if err := cmd.Flags().Set(outputFlag, "json"); err != nil { |
| 39 | panic(err) |
| 40 | } |
| 41 | if stdout != nil { |
| 42 | cmd.SetOut(stdout) |
| 43 | } |
| 44 | if stderr != nil { |
| 45 | cmd.SetErr(stderr) |
| 46 | } |
| 47 | return cmd |
| 48 | } |
| 49 | |
| 50 | type getOutputData struct { |
| 51 | Input getCommandInput `json:"input"` |
no test coverage detected