Skip to content

Commit

Permalink
fix(go): return error for invalid done index
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmlft committed Oct 22, 2024
1 parent a4d2ee4 commit 931900d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion todo-go/cmd/done.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ func doneRun(cmd *cobra.Command, args []string) {
if err != nil {
log.Fatalln(args[0], "is not a valid ID\n", err)
}
todos.Complete(id)
err = todos.Complete(id)
if err != nil {
log.Fatalf("Error: %v", err)
}
db.WriteTodos(todos)

if verbose, _ := cmd.Flags().GetBool("verbose"); verbose {
Expand Down

0 comments on commit 931900d

Please sign in to comment.