Skip to content

Commit

Permalink
log.Fatal() doesn't require os.Exit() afterwards
Browse files Browse the repository at this point in the history
  • Loading branch information
diogomatsubara committed Jul 31, 2023
1 parent 4e3ec2e commit 866a47e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
4 changes: 1 addition & 3 deletions cmd/create/firmware_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package create
import (
"fmt"
"log"
"os"

"github.com/google/uuid"
mctl "github.com/metal-toolbox/mctl/cmd"
Expand Down Expand Up @@ -46,8 +45,7 @@ var createFirmwareSet = &cobra.Command{
for _, id := range definedfirmwareSetFlags.AddFirmwareUUIDs {
_, err = uuid.Parse(id)
if err != nil {
log.Println(err.Error())
os.Exit(1)
log.Fatal(err)
}

payload.ComponentFirmwareUUIDs = append(payload.ComponentFirmwareUUIDs, id)
Expand Down
3 changes: 0 additions & 3 deletions cmd/edit/firmware_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package edit
import (
"fmt"
"log"
"os"

"github.com/google/uuid"
mctl "github.com/metal-toolbox/mctl/cmd"
Expand Down Expand Up @@ -57,7 +56,6 @@ var editFirmwareSet = &cobra.Command{
_, err = uuid.Parse(id)
if err != nil {
log.Fatal(err)
os.Exit(1)
}

payload.ComponentFirmwareUUIDs = append(payload.ComponentFirmwareUUIDs, id)
Expand All @@ -83,7 +81,6 @@ var editFirmwareSet = &cobra.Command{
_, err = uuid.Parse(id)
if err != nil {
log.Fatal(err)
os.Exit(1)
}

payload.ComponentFirmwareUUIDs = append(payload.ComponentFirmwareUUIDs, id)
Expand Down

0 comments on commit 866a47e

Please sign in to comment.