Skip to content

Commit

Permalink
update test case in fanout_test.go to reflect omitempty behavior for …
Browse files Browse the repository at this point in the history
…Attempts field in JSON output
  • Loading branch information
KingPin committed Mar 1, 2025
1 parent d1490ab commit 1fa7936
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fanout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ func TestWriteJSON(t *testing.T) {
},
{
name: "Response object",
// Include the Attempts field explicitly to match JSON output expectations
data: Response{
Target: "http://example.com",
Status: 200,
Body: "OK",
Attempts: 0, // Explicitly set to 0 to ensure it appears in JSON
Attempts: 0, // Due to omitempty tag, this won't appear in JSON when 0
},
expected: `{"target":"http://example.com","status":200,"body":"OK","latency":0,"attempts":0}`,
// Updated expected value - removed attempts since it has omitempty tag
expected: `{"target":"http://example.com","status":200,"body":"OK","latency":0}`,
},
}

Expand Down

0 comments on commit 1fa7936

Please sign in to comment.