style: gofmt struct-tag alignment across v0 files

v0 landed with a few misaligned struct tags and fields; gofmt -l
flagged categories.go, topics.go, discourse_test.go and the smoke
fake. Alignment only, no behavior change, so the tree passes the
gofmt gate cleanly.
This commit is contained in:
2026-08-29 16:20:44 -05:00
parent f9cf30bc72
commit f51ca5900c
4 changed files with 13 additions and 13 deletions
+7 -7
View File
@@ -28,13 +28,13 @@ type Category struct {
// means "default: everyone full" — for restricted categories set it
// explicitly, e.g. {"staff": 3, "trust_level_0": 1}.
type CreateCategoryRequest struct {
Name string `json:"name"`
Color string `json:"color"` // 6 hex digits, no '#'
TextColor string `json:"text_color"` // 6 hex digits, no '#'
Permissions map[string]int `json:"permissions,omitempty"`
Position int `json:"position,omitempty"`
ParentCategoryID int `json:"parent_category_id,omitempty"`
Description string `json:"description,omitempty"`
Name string `json:"name"`
Color string `json:"color"` // 6 hex digits, no '#'
TextColor string `json:"text_color"` // 6 hex digits, no '#'
Permissions map[string]int `json:"permissions,omitempty"`
Position int `json:"position,omitempty"`
ParentCategoryID int `json:"parent_category_id,omitempty"`
Description string `json:"description,omitempty"`
}
// ListCategories returns the instance's categories (one request; the
+4 -4
View File
@@ -82,15 +82,15 @@ func newFake(t *testing.T) *fakeDiscourse {
}
if req.Name == "denied" { // simulate a non-admin key
writeJSON(w, 403, map[string]any{
"errors": []string{"You are not permitted to view the requested resource."},
"error_description": "Access denied",
"errors": []string{"You are not permitted to view the requested resource."},
"error_description": "Access denied",
})
return
}
f.mu.Lock()
cat := Category{
ID: f.nextCat, Name: req.Name,
Slug: strings.ToLower(strings.ReplaceAll(req.Name, " ", "-")),
Slug: strings.ToLower(strings.ReplaceAll(req.Name, " ", "-")),
Color: req.Color, TextColor: req.TextColor, Position: req.Position,
}
f.nextCat++
@@ -158,7 +158,7 @@ func newFake(t *testing.T) *fakeDiscourse {
case http.MethodPut:
var body struct {
Post struct {
Raw string `json:"raw"`
Raw string `json:"raw"`
EditReason string `json:"edit_reason"`
} `json:"post"`
}
+1 -1
View File
@@ -69,7 +69,7 @@ func main() {
name, _ := req["name"].(string)
cat := map[string]any{
"id": s.nextCat, "name": name,
"slug": strings.ToLower(strings.ReplaceAll(name, " ", "-")),
"slug": strings.ToLower(strings.ReplaceAll(name, " ", "-")),
"color": orDefault(req["color"], "3AB54A"), "text_color": orDefault(req["text_color"], "FFFFFF"),
"topic_count": 0,
}
+1 -1
View File
@@ -31,7 +31,7 @@ type Topic struct {
CategoryID int `json:"category_id"`
CreatedAt string `json:"created_at"`
Closed bool `json:"closed"`
Archived bool `json:"archived"`
Archived bool `json:"archived"`
PostStream struct {
Posts []Post `json:"posts"`
} `json:"post_stream"`