Merge pull request #11 from hashicorp/f-remove-unrequired-errorf
chore: remove use of fmt.Errorf when not needed.
This commit is contained in:
commit
b006b037e6
1 changed files with 4 additions and 3 deletions
|
@ -2,6 +2,7 @@ package hello
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
@ -419,7 +420,7 @@ func (d *HelloDriverPlugin) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHan
|
||||||
// RecoverTask recreates the in-memory state of a task from a TaskHandle.
|
// RecoverTask recreates the in-memory state of a task from a TaskHandle.
|
||||||
func (d *HelloDriverPlugin) RecoverTask(handle *drivers.TaskHandle) error {
|
func (d *HelloDriverPlugin) RecoverTask(handle *drivers.TaskHandle) error {
|
||||||
if handle == nil {
|
if handle == nil {
|
||||||
return fmt.Errorf("error: handle cannot be nil")
|
return errors.New("error: handle cannot be nil")
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := d.tasks.Get(handle.Config.ID); ok {
|
if _, ok := d.tasks.Get(handle.Config.ID); ok {
|
||||||
|
@ -552,7 +553,7 @@ func (d *HelloDriverPlugin) DestroyTask(taskID string, force bool) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if handle.IsRunning() && !force {
|
if handle.IsRunning() && !force {
|
||||||
return fmt.Errorf("cannot destroy running task")
|
return errors.New("cannot destroy running task")
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: implement driver specific logic to destroy a complete task.
|
// TODO: implement driver specific logic to destroy a complete task.
|
||||||
|
@ -635,5 +636,5 @@ func (d *HelloDriverPlugin) SignalTask(taskID string, signal string) error {
|
||||||
// This is an optional capability.
|
// This is an optional capability.
|
||||||
func (d *HelloDriverPlugin) ExecTask(taskID string, cmd []string, timeout time.Duration) (*drivers.ExecTaskResult, error) {
|
func (d *HelloDriverPlugin) ExecTask(taskID string, cmd []string, timeout time.Duration) (*drivers.ExecTaskResult, error) {
|
||||||
// TODO: implement driver specific logic to execute commands in a task.
|
// TODO: implement driver specific logic to execute commands in a task.
|
||||||
return nil, fmt.Errorf("This driver does not support exec")
|
return nil, errors.New("This driver does not support exec")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue