allow adding ssh key directly to instance#40
Conversation
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.46.0 to 0.47.0. - [Commits](golang/crypto@v0.46.0...v0.47.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-version: 0.47.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…ang.org/x/crypto-0.47.0 chore(deps): bump golang.org/x/crypto from 0.46.0 to 0.47.0
…ang.org/x/sys-0.40.0 chore(deps): bump golang.org/x/sys from 0.39.0 to 0.40.0
switching to a6000
Enable port forwarding
Sentry Feat
Resolved conflicts: - api/types.go: Kept HttpPorts from main and ProvisioningTime from feature branch - tui/status.go: Kept UUID column width, updated Status width to 14 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sentry Cleanup
…on_clarity removed color gradient
…into brian/add-ssh-key
| } | ||
| return err | ||
| } | ||
| instanceID = selectedInstance.ID |
Check warning
Code scanning / CodeQL
Useless assignment to local variable Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 11 days ago
In general, to fix a useless assignment, either remove the assignment if the variable’s value is not needed, or, if the value should be used, update the code to actually read it instead of another source. Here, in the interactive path (len(args) == 0), the logic already works entirely through selectedInstance and the interactive TUI flow, and there is no read of instanceID after we set it to selectedInstance.ID. The non-interactive path still assigns instanceID = args[0] and uses it in error messages; that behavior should remain unchanged.
The best minimal fix without changing functionality is to remove the line instanceID = selectedInstance.ID at line 99. This eliminates the useless assignment and potential confusion, while preserving the rest of the logic: for the interactive path, we rely solely on selectedInstance returned from tui.RunAddKeyInteractive; for the non-interactive path, we keep using instanceID derived from args[0]. No new imports, functions, or definitions are required.
Concretely: in cmd/add_key.go, within the if len(args) == 0 { ... } block, delete the line that sets instanceID = selectedInstance.ID. Leave the rest of the branches as they are.
| @@ -96,7 +96,6 @@ | ||
| } | ||
| return err | ||
| } | ||
| instanceID = selectedInstance.ID | ||
| } else { | ||
| instanceID = args[0] | ||
|
|
No description provided.