Fix govet issues

This commit is contained in:
Chris Bednarski 2015-08-05 19:41:29 -07:00
parent 02273207df
commit abb67fdd79
5 changed files with 5 additions and 10 deletions

View File

@ -88,7 +88,7 @@ func (a *Artifact) Destroy() error {
if len(errors) == 1 { if len(errors) == 1 {
return errors[0] return errors[0]
} else { } else {
return &packer.MultiError{errors} return &packer.MultiError{Errors: errors}
} }
} }

View File

@ -181,8 +181,6 @@ func WaitForState(conf *StateChangeConf) (i interface{}, err error) {
time.Sleep(time.Duration(sleepSeconds) * time.Second) time.Sleep(time.Duration(sleepSeconds) * time.Second)
} }
return
} }
func isTransientNetworkError(err error) bool { func isTransientNetworkError(err error) bool {

View File

@ -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) log.Printf("Waiting for state to become: %s currently %s (%d%%)", conf.Target, currentState, currentProgress)
time.Sleep(2 * time.Second) time.Sleep(2 * time.Second)
} }
return
} }

View File

@ -1,13 +1,13 @@
package rpc package rpc
import ( import (
"fmt"
"github.com/hashicorp/go-msgpack/codec"
"github.com/mitchellh/packer/packer"
"io" "io"
"log" "log"
"net/rpc" "net/rpc"
"sync/atomic" "sync/atomic"
"github.com/hashicorp/go-msgpack/codec"
"github.com/mitchellh/packer/packer"
) )
var endpointId uint64 var endpointId uint64
@ -149,7 +149,7 @@ func (s *Server) Serve() {
func registerComponent(server *rpc.Server, name string, rcvr interface{}, id bool) string { func registerComponent(server *rpc.Server, name string, rcvr interface{}, id bool) string {
endpoint := name endpoint := name
if id { if id {
fmt.Sprintf("%s.%d", endpoint, atomic.AddUint64(&endpointId, 1)) log.Printf("%s.%d", endpoint, atomic.AddUint64(&endpointId, 1))
} }
server.RegisterName(endpoint, rcvr) server.RegisterName(endpoint, rcvr)

View File

@ -134,7 +134,6 @@ WaitLoop:
case <-p.cancel: case <-p.cancel:
close(waitDone) close(waitDone)
return fmt.Errorf("Interrupt detected, quitting waiting for machine to restart") return fmt.Errorf("Interrupt detected, quitting waiting for machine to restart")
break WaitLoop
} }
} }