(detail WorkspaceDetailRecord, resolutionSource ...string)
| 438 | } |
| 439 | |
| 440 | func workspaceDetailBundle(detail WorkspaceDetailRecord, resolutionSource ...string) outputBundle { |
| 441 | jsonValue := any(detail) |
| 442 | if len(resolutionSource) > 0 && strings.TrimSpace(resolutionSource[0]) != "" { |
| 443 | jsonValue = workspaceDetailOutput{ |
| 444 | WorkspaceDetailRecord: detail, |
| 445 | ResolutionSource: strings.TrimSpace(resolutionSource[0]), |
| 446 | } |
| 447 | } |
| 448 | return outputBundle{ |
| 449 | jsonValue: jsonValue, |
| 450 | human: func() (string, error) { return renderWorkspaceDetailHuman(detail) }, |
| 451 | toon: func() (string, error) { return renderWorkspaceDetailToon(detail) }, |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | func renderWorkspaceDetailHuman(detail WorkspaceDetailRecord) (string, error) { |
| 456 | workspaceBlock, err := workspaceRecordBundle(detail.Workspace).human() |
no test coverage detected