From abb67fdd7964385c23c9a57349bc07158f25798d Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Wed, 5 Aug 2015 19:41:29 -0700 Subject: [PATCH] Fix govet issues --- builder/amazon/common/artifact.go | 2 +- builder/amazon/common/state.go | 2 -- builder/openstack/server.go | 2 -- packer/rpc/server.go | 8 ++++---- provisioner/windows-restart/provisioner.go | 1 - 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/builder/amazon/common/artifact.go b/builder/amazon/common/artifact.go index aba2ffde4..4082b2abc 100644 --- a/builder/amazon/common/artifact.go +++ b/builder/amazon/common/artifact.go @@ -88,7 +88,7 @@ func (a *Artifact) Destroy() error { if len(errors) == 1 { return errors[0] } else { - return &packer.MultiError{errors} + return &packer.MultiError{Errors: errors} } } diff --git a/builder/amazon/common/state.go b/builder/amazon/common/state.go index 075ce8ef7..3b40a48d1 100644 --- a/builder/amazon/common/state.go +++ b/builder/amazon/common/state.go @@ -181,8 +181,6 @@ func WaitForState(conf *StateChangeConf) (i interface{}, err error) { time.Sleep(time.Duration(sleepSeconds) * time.Second) } - - return } func isTransientNetworkError(err error) bool { diff --git a/builder/openstack/server.go b/builder/openstack/server.go index 482657c03..0897821a8 100644 --- a/builder/openstack/server.go +++ b/builder/openstack/server.go @@ -92,6 +92,4 @@ func WaitForState(conf *StateChangeConf) (i interface{}, err error) { log.Printf("Waiting for state to become: %s currently %s (%d%%)", conf.Target, currentState, currentProgress) time.Sleep(2 * time.Second) } - - return } diff --git a/packer/rpc/server.go b/packer/rpc/server.go index b6d17dacf..ceb77a8d3 100644 --- a/packer/rpc/server.go +++ b/packer/rpc/server.go @@ -1,13 +1,13 @@ package rpc import ( - "fmt" - "github.com/hashicorp/go-msgpack/codec" - "github.com/mitchellh/packer/packer" "io" "log" "net/rpc" "sync/atomic" + + "github.com/hashicorp/go-msgpack/codec" + "github.com/mitchellh/packer/packer" ) var endpointId uint64 @@ -149,7 +149,7 @@ func (s *Server) Serve() { func registerComponent(server *rpc.Server, name string, rcvr interface{}, id bool) string { endpoint := name if id { - fmt.Sprintf("%s.%d", endpoint, atomic.AddUint64(&endpointId, 1)) + log.Printf("%s.%d", endpoint, atomic.AddUint64(&endpointId, 1)) } server.RegisterName(endpoint, rcvr) diff --git a/provisioner/windows-restart/provisioner.go b/provisioner/windows-restart/provisioner.go index 4b6af609e..2e4b7c371 100644 --- a/provisioner/windows-restart/provisioner.go +++ b/provisioner/windows-restart/provisioner.go @@ -134,7 +134,6 @@ WaitLoop: case <-p.cancel: close(waitDone) return fmt.Errorf("Interrupt detected, quitting waiting for machine to restart") - break WaitLoop } }