Fix noinlineerr findings: internal/cli (refs #61)

This commit is contained in:
2026-08-07 16:59:56 +00:00
parent 26909b058a
commit 2f7e37153c
6 changed files with 46 additions and 21 deletions

View File

@@ -64,7 +64,8 @@ Use --force to skip the confirmation prompt.`,
dbPath := cfg.IndexPath
// Check if database exists
if _, err := os.Stat(dbPath); os.IsNotExist(err) {
_, err = os.Stat(dbPath)
if os.IsNotExist(err) {
fmt.Printf("Database does not exist: %s\n", dbPath)
return nil
@@ -76,7 +77,9 @@ Use --force to skip the confirmation prompt.`,
fmt.Print("Are you sure? Type 'yes' to confirm: ")
var confirm string
if _, err := fmt.Scanln(&confirm); err != nil || confirm != "yes" {
_, err = fmt.Scanln(&confirm)
if err != nil || confirm != "yes" {
fmt.Println("Aborted.")
return nil
@@ -84,7 +87,8 @@ Use --force to skip the confirmation prompt.`,
}
// Delete the database file
if err := os.Remove(dbPath); err != nil {
err = os.Remove(dbPath)
if err != nil {
return fmt.Errorf("failed to delete database: %w", err)
}