Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Commit e68164f

Browse files
committed
refactor: De-duplicate error messages
1 parent 77b73a2 commit e68164f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cmd/dhclientctl/cmd/root.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cmd
22

33
import (
4+
constants "github.com/pojntfx/go-isc-dhcp/cmd"
45
"github.com/spf13/cobra"
56
"github.com/spf13/viper"
67
"gitlab.com/bloom42/libs/rz-go"
@@ -24,6 +25,6 @@ https://pojntfx.github.io/go-isc-dhcp/`,
2425
// Execute starts the root command.
2526
func Execute() {
2627
if err := rootCmd.Execute(); err != nil {
27-
log.Fatal("Could not start root command", rz.Err(err))
28+
log.Fatal(constants.CouldNotStartRootCommandErrorMessage, rz.Err(err))
2829
}
2930
}

cmd/dhcpdctl/cmd/root.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cmd
22

33
import (
4+
constants "github.com/pojntfx/go-isc-dhcp/cmd"
45
"github.com/spf13/cobra"
56
"github.com/spf13/viper"
67
"gitlab.com/bloom42/libs/rz-go"
@@ -24,6 +25,6 @@ https://pojntfx.github.io/go-isc-dhcp/`,
2425
// Execute starts the root command.
2526
func Execute() {
2627
if err := rootCmd.Execute(); err != nil {
27-
log.Fatal("Could not start root command", rz.Err(err))
28+
log.Fatal(constants.CouldNotStartRootCommandErrorMessage, rz.Err(err))
2829
}
2930
}

0 commit comments

Comments
 (0)