Skip to content

Commit

Permalink
moar json fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Feb 4, 2024
1 parent 85e4cb7 commit 2600b44
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ func (c *CmdResult) MarshalJSON() ([]byte, error) {
m["type"] = fmt.Sprintf("%T", c)

if c.Result != nil {
m["result"] = c.Result
y := struct {
*clam.Result
Type string `json:"type,omitempty"`
}{
Result: c.Result,
Type: fmt.Sprintf("%T", c.Result),
}
m["result"] = y
}

return json.Marshal(m)
Expand Down

0 comments on commit 2600b44

Please sign in to comment.