-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*: fix JSON marshaling for nil slices in rules
Go's `encoding/json` turns nil slices into `null` instead of `[]`. This is problematic for consumers expecting that the `alerts` field is a JSON array. The same is true for empty rule groups. The solution is to enforce that nil slices are converted to zero-length slices when encoding. Signed-off-by: Simon Pasquier <[email protected]>
- Loading branch information
1 parent
1ae66b9
commit 1054588
Showing
3 changed files
with
91 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters