From 8af6bbdc8e20db613456de85e37a9eb27f7bf42d Mon Sep 17 00:00:00 2001 From: kami Date: Mon, 27 Jul 2026 19:04:50 +0400 Subject: [PATCH] fix(operations): repair duplicate json struct tags (S1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Brief.From/To both serialized as "from" (repeated tag key on one combined field declaration), and GitSync.Branch/Head/Status all serialized as "branch" — Go only honors the first `json:"..."` tag on a struct field, so the second and third tags in `json:"branch" json:"head" json:"status"` were silently ignored. go vet ./... failed on this; the brief's git state was unparseable by any client since Head and Status never appeared in the JSON at all and From/To collided. Split the combined declarations so each field gets its own tag. go vet ./... now passes clean. AUDIT.md S1. --- internal/operations/operations.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/operations/operations.go b/internal/operations/operations.go index a652c8a..7a7e2cd 100644 --- a/internal/operations/operations.go +++ b/internal/operations/operations.go @@ -13,7 +13,8 @@ import ( ) type Brief struct { - From, To time.Time `json:"from"` + From time.Time `json:"from"` + To time.Time `json:"to"` Completed int `json:"completed"` Failed int `json:"failed"` Blocked int `json:"blocked"` @@ -22,7 +23,9 @@ type Brief struct { Git GitSync `json:"git_sync"` } type GitSync struct { - Branch, Head, Status string `json:"branch" json:"head" json:"status"` + Branch string `json:"branch"` + Head string `json:"head"` + Status string `json:"status"` } type StandupItem struct {