Fix noinlineerr findings: internal/cli (refs #61)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user