Add omitempty to JSON fields in alert, forecast, and observation services
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful

This commit is contained in:
2026-03-17 09:03:23 -05:00
parent 27817f9e43
commit 0d82e5d60e
4 changed files with 104 additions and 37 deletions

View File

@@ -21,13 +21,13 @@ type Response struct {
}
type AlertResponse struct {
Effective *time.Time `json:"effective"`
Expires *time.Time `json:"expires"`
Severity *string `json:"severity"`
Event *string `json:"event"`
Headline *string `json:"headline"`
Instruction *string `json:"instruction"`
Description *string `json:"description"`
Effective *time.Time `json:"effective,omitempty"`
Expires *time.Time `json:"expires,omitempty"`
Severity *string `json:"severity,omitempty"`
Event *string `json:"event,omitempty"`
Headline *string `json:"headline,omitempty"`
Instruction *string `json:"instruction,omitempty"`
Description *string `json:"description,omitempty"`
}
func (s *Service) GetCurrent(ctx context.Context) (Response, error) {