small edit
All checks were successful
Tests / test (pull_request) Successful in 18s

This commit is contained in:
Dan Anglin 2024-08-21 12:17:37 +01:00
parent 5576a8c986
commit 49b734f925
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638
2 changed files with 18 additions and 36 deletions

View file

@ -139,8 +139,7 @@ func {{ $execute_command_function_name }}(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("({{ $name }}) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("({{ $name }}) unable to load configuration: " + err.Error() + ".")
return err
}

View file

@ -109,8 +109,7 @@ func ExecuteAcceptCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(accept) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(accept) unable to load configuration: " + err.Error() + ".")
return err
}
@ -183,8 +182,7 @@ func ExecuteAddCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(add) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(add) unable to load configuration: " + err.Error() + ".")
return err
}
@ -246,8 +244,7 @@ func ExecuteBlockCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(block) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(block) unable to load configuration: " + err.Error() + ".")
return err
}
@ -357,8 +354,7 @@ func ExecuteCreateCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(create) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(create) unable to load configuration: " + err.Error() + ".")
return err
}
@ -423,8 +419,7 @@ func ExecuteDeleteCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(delete) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(delete) unable to load configuration: " + err.Error() + ".")
return err
}
@ -498,8 +493,7 @@ func ExecuteEditCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(edit) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(edit) unable to load configuration: " + err.Error() + ".")
return err
}
@ -565,8 +559,7 @@ func ExecuteFollowCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(follow) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(follow) unable to load configuration: " + err.Error() + ".")
return err
}
@ -668,8 +661,7 @@ func ExecuteLoginCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(login) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(login) unable to load configuration: " + err.Error() + ".")
return err
}
@ -738,8 +730,7 @@ func ExecuteMuteCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(mute) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(mute) unable to load configuration: " + err.Error() + ".")
return err
}
@ -801,8 +792,7 @@ func ExecuteRejectCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(reject) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(reject) unable to load configuration: " + err.Error() + ".")
return err
}
@ -870,8 +860,7 @@ func ExecuteRemoveCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(remove) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(remove) unable to load configuration: " + err.Error() + ".")
return err
}
@ -972,8 +961,7 @@ func ExecuteShowCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(show) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(show) unable to load configuration: " + err.Error() + ".")
return err
}
@ -1035,8 +1023,7 @@ func ExecuteSwitchCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(switch) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(switch) unable to load configuration: " + err.Error() + ".")
return err
}
@ -1098,8 +1085,7 @@ func ExecuteUnblockCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(unblock) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(unblock) unable to load configuration: " + err.Error() + ".")
return err
}
@ -1161,8 +1147,7 @@ func ExecuteUnfollowCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(unfollow) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(unfollow) unable to load configuration: " + err.Error() + ".")
return err
}
@ -1226,8 +1211,7 @@ func ExecuteUnmuteCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(unmute) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(unmute) unable to load configuration: " + err.Error() + ".")
return err
}
@ -1329,8 +1313,7 @@ func ExecuteWhoamiCommand(
// Load the configuration from file.
exeConfig, err := config.NewConfigFromFile(exe.configDir)
if err != nil {
tempPrinter := printer.NewPrinter(noColor, "", 0)
tempPrinter.PrintFailure("(whoami) unable to load configuration: " + err.Error() + ".")
printer.NewPrinter(noColor, "", 0).PrintFailure("(whoami) unable to load configuration: " + err.Error() + ".")
return err
}