From 794cf4cf4d74b785b9308cb7bbec7ff552c64410 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Thu, 28 Jan 2016 11:15:12 +0100 Subject: [PATCH] Make go vet ./... happy Signed-off-by: David Gageot --- commands/commands_test.go | 4 +++- libmachine/host/host_test.go | 2 +- libmachine/libmachine.go | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) 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 {