fix(operations): repair duplicate json struct tags (S1)
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.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user