Skip to content

Commit 4fe1d3e

Browse files
crrowclaude
andcommitted
fix(deps): resolve named return shadowing
Remove redeclared `deps` variable and rename loop variable `name` to `depName` to avoid shadowing the named return. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c89f703 commit 4fe1d3e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

internal/deps/commands.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,16 +270,15 @@ func parseCrateDeps(tomlPath string, workspaceCrates map[string]bool) (name stri
270270
return "", nil, fmt.Errorf("no package name found in %s", tomlPath)
271271
}
272272

273-
var deps []string
274273
for _, section := range []map[string]any{crate.Dependencies, crate.BuildDependencies} {
275-
for name, val := range section {
276-
if !workspaceCrates[name] {
274+
for depName, val := range section {
275+
if !workspaceCrates[depName] {
277276
continue
278277
}
279278
if tbl, ok := val.(map[string]any); ok {
280279
if ws, exists := tbl["workspace"]; exists {
281280
if b, ok := ws.(bool); ok && b {
282-
deps = append(deps, name)
281+
deps = append(deps, depName)
283282
}
284283
}
285284
}

0 commit comments

Comments
 (0)