Skip to content

Commit e80d3c0

Browse files
committed
fix: use type conversion instead of struct literal for NPCTagInfo (S1016)
Fixes staticcheck S1016: TagInfo and NPCTagInfo have identical fields, so direct type conversion is cleaner than field-by-field struct literal. https://claude.ai/code/session_01PeB1HsjEYNPSY2iqa7sqqR
1 parent 5c74093 commit e80d3c0

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

internal/plugins/npcs/service.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ func (s *npcService) ListNPCs(ctx context.Context, campaignID string, role int,
7676
for i := range cards {
7777
if infos, ok := tagMap[cards[i].ID]; ok {
7878
for _, t := range infos {
79-
cards[i].Tags = append(cards[i].Tags, NPCTagInfo{
80-
ID: t.ID, Name: t.Name, Slug: t.Slug, Color: t.Color,
81-
})
79+
cards[i].Tags = append(cards[i].Tags, NPCTagInfo(t))
8280
}
8381
}
8482
}

0 commit comments

Comments
 (0)