aboutsummaryrefslogtreecommitdiff
path: root/internal/osv/osv.go
diff options
context:
space:
mode:
authorHana Kim <hyangah@gmail.com>2026-03-05 22:46:27 -0500
committerGopher Robot <gobot@golang.org>2026-03-26 12:10:46 -0700
commit1759ab89b6a1a1cefe7bd2c75e106d15ae6f9e77 (patch)
treebd402566b547a83fadeb1311d28620bbab4daabc /internal/osv/osv.go
parent06c847e1184d477cfb622ff6710b48848bf0ffcf (diff)
downloadgo-x-pkgsite-1759ab89b6a1a1cefe7bd2c75e106d15ae6f9e77.tar.xz
internal/osv: remove ineffective omitempty
This was modified by go fix -omitzero. The intention was probably to omit the fields (of time.Time type) when they are zero values. However, omitempty doesn't do it. I considered to set them for omitzero, but it's delicate. - Modified field is "required" field per spec. - Published is an optional field but our codebase assumes it's always present (and optionally uses the Modified field only if it differs from Published). In practice, probably it's always set any way. Just remove the tag so the future `go fix` run doesn't cause churn. Change-Id: I1138e629e2d3f77d96167f3a52413a08b15821cd Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/753426 Auto-Submit: Hyang-Ah Hana Kim <hyangah@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'internal/osv/osv.go')
-rw-r--r--internal/osv/osv.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/osv/osv.go b/internal/osv/osv.go
index ebc95ffd..6a307d88 100644
--- a/internal/osv/osv.go
+++ b/internal/osv/osv.go
@@ -192,10 +192,10 @@ type Entry struct {
// GO-<YEAR>-<ENTRYID>.
ID string `json:"id"`
// Modified is the time the entry was last modified. Required.
- Modified time.Time `json:"modified,omitempty"`
+ Modified time.Time `json:"modified"`
// Published is the time the entry should be considered to have
// been published.
- Published time.Time `json:"published,omitempty"`
+ Published time.Time `json:"published"`
// Withdrawn is the time the entry should be considered to have
// been withdrawn. If the field is missing, then the entry has
// not been withdrawn.