fix(lint): fix errcheck and misspell in orphans.go
- Check fmt.Scanln return values (errcheck) - Fix "Cancelled" → "Canceled" spelling (misspell) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -399,9 +399,9 @@ func runOrphansKill(cmd *cobra.Command, args []string) error {
|
|||||||
fmt.Printf("%s\n", style.Warning.Render("WARNING: This operation is irreversible!"))
|
fmt.Printf("%s\n", style.Warning.Render("WARNING: This operation is irreversible!"))
|
||||||
fmt.Printf("Remove %d orphaned commit(s)? [y/N] ", len(filtered))
|
fmt.Printf("Remove %d orphaned commit(s)? [y/N] ", len(filtered))
|
||||||
var response string
|
var response string
|
||||||
fmt.Scanln(&response)
|
_, _ = fmt.Scanln(&response)
|
||||||
if strings.ToLower(strings.TrimSpace(response)) != "y" {
|
if strings.ToLower(strings.TrimSpace(response)) != "y" {
|
||||||
fmt.Printf("%s Cancelled\n", style.Dim.Render("ℹ"))
|
fmt.Printf("%s Canceled\n", style.Dim.Render("ℹ"))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -568,7 +568,7 @@ func runOrphansKillProcesses(cmd *cobra.Command, args []string) error {
|
|||||||
if !orphansProcsForce {
|
if !orphansProcsForce {
|
||||||
fmt.Printf("Kill these %d process(es)? [y/N] ", len(orphans))
|
fmt.Printf("Kill these %d process(es)? [y/N] ", len(orphans))
|
||||||
var response string
|
var response string
|
||||||
fmt.Scanln(&response)
|
_, _ = fmt.Scanln(&response)
|
||||||
response = strings.ToLower(strings.TrimSpace(response))
|
response = strings.ToLower(strings.TrimSpace(response))
|
||||||
if response != "y" && response != "yes" {
|
if response != "y" && response != "yes" {
|
||||||
fmt.Println("Aborted")
|
fmt.Println("Aborted")
|
||||||
|
|||||||
Reference in New Issue
Block a user