Skip to content

Commit cc1ff1d

Browse files
committed
chore(agent): satisfy staticcheck S1016 on capabilities handler
CapabilityEntry has the same field types as ProbeResult (just JSON tags on top), so staticcheck wants the explicit conversion instead of a field-by-field literal. Functionally identical — stable Go conversion since 1.8 (struct tags don't affect convertibility).
1 parent f1e284b commit cc1ff1d

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

gearbox-agent/internal/framework/gear/manager.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,7 @@ func (m *Manager) handleCapabilities(w http.ResponseWriter, r *http.Request) {
496496
out := CapabilitiesResponse{Gears: make(map[string]CapabilityEntry, len(plugins))}
497497
for _, p := range plugins {
498498
name := p.Info().Name
499-
pr := results[name]
500-
out.Gears[name] = CapabilityEntry{
501-
Status: pr.Status,
502-
Reason: pr.Reason,
503-
Capabilities: pr.Capabilities,
504-
}
499+
out.Gears[name] = CapabilityEntry(results[name])
505500
}
506501
w.Header().Set("Content-Type", "application/json")
507502
if err := json.NewEncoder(w).Encode(out); err != nil {

0 commit comments

Comments
 (0)