Skip to content

Commit

Permalink
chore: add omitempty to some fields in CompileError and Warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Sep 18, 2024
1 parent d8f28da commit aee95d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions go/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ type CompileError struct {
// Error title (e.g: "unknown identifier `foo`").
Title string `json:"title"`
// Each of the labels in the error report.
Labels []Label `json:"labels"`
Labels []Label `json:"labels,omitempty"`
// Each of the footers in the error report.
Footers []Footer `json:"footers"`
Footers []Footer `json:"footers,omitempty"`
// The error's full report, as shown by the command-line tool.
Text string `json:"text"`
}
Expand All @@ -144,9 +144,9 @@ type Warning struct {
// Error title (e.g: "slow pattern").
Title string `json:"title"`
// Each of the labels in the warning report.
Labels []Label `json:"labels"`
Labels []Label `json:"labels,omitempty"`
// Each of the footers in the warning report.
Footers []Footer `json:"footers"`
Footers []Footer `json:"footers,omitempty"`
// The error's full report, as shown by the command-line tool.
Text string `json:"text"`
}
Expand Down

0 comments on commit aee95d1

Please sign in to comment.