diff --git a/commands/commands_test.go b/commands/commands_test.go index 81c5a1ea80..8a8c21944b 100644 --- a/commands/commands_test.go +++ b/commands/commands_test.go @@ -205,7 +205,9 @@ func TestReturnExitCode1onError(t *testing.T) { func TestReturnExitCode3onErrorDuringPreCreate(t *testing.T) { command := func(commandLine CommandLine, api libmachine.API) error { - return mcnerror.ErrDuringPreCreate{errors.New("foo is not bar")} + return mcnerror.ErrDuringPreCreate{ + Cause: errors.New("foo is not bar"), + } } exitCode := checkErrorCodeForCommand(command) diff --git a/libmachine/host/host_test.go b/libmachine/host/host_test.go index e1bc716f91..dc9643af4e 100644 --- a/libmachine/host/host_test.go +++ b/libmachine/host/host_test.go @@ -69,7 +69,7 @@ func NewNetstatProvisioner() provision.Provisioner { func TestStart(t *testing.T) { provision.SetDetector(&provision.FakeDetector{ - NewNetstatProvisioner(), + Provisioner: NewNetstatProvisioner(), }) host := &Host{ diff --git a/libmachine/libmachine.go b/libmachine/libmachine.go index 83306743e2..9389757005 100644 --- a/libmachine/libmachine.go +++ b/libmachine/libmachine.go @@ -123,7 +123,9 @@ func (api *Client) Create(h *host.Host) error { log.Info("Running pre-create checks...") if err := h.Driver.PreCreateCheck(); err != nil { - return mcnerror.ErrDuringPreCreate{err} + return mcnerror.ErrDuringPreCreate{ + Cause: err, + } } if err := api.Save(h); err != nil {