Commit 44bd56c3 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

go fmt

parent 368ccab8
...@@ -17,7 +17,7 @@ func TestBuilder_Prepare_BadType(t *testing.T) { ...@@ -17,7 +17,7 @@ func TestBuilder_Prepare_BadType(t *testing.T) {
assert := asserts.NewTestingAsserts(t, true) assert := asserts.NewTestingAsserts(t, true)
b := &Builder{} b := &Builder{}
c := map[string]interface{} { c := map[string]interface{}{
"access_key": []string{}, "access_key": []string{},
} }
...@@ -29,7 +29,7 @@ func TestBuilder_Prepare_Good(t *testing.T) { ...@@ -29,7 +29,7 @@ func TestBuilder_Prepare_Good(t *testing.T) {
assert := asserts.NewTestingAsserts(t, true) assert := asserts.NewTestingAsserts(t, true)
b := &Builder{} b := &Builder{}
c := map[string]interface{} { c := map[string]interface{}{
"access_key": "foo", "access_key": "foo",
"secret_key": "bar", "secret_key": "bar",
"source_ami": "123456", "source_ami": "123456",
......
package build package build
import ( import (
"bytes" "bytes"
"cgl.tideland.biz/asserts" "cgl.tideland.biz/asserts"
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
package main package main
import ( import (
"fmt"
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/packer/plugin" "github.com/mitchellh/packer/packer/plugin"
"fmt"
"io/ioutil" "io/ioutil"
"log" "log"
"os" "os"
......
...@@ -13,4 +13,3 @@ type Builder interface { ...@@ -13,4 +13,3 @@ type Builder interface {
Prepare(config interface{}) error Prepare(config interface{}) error
Run(build Build, ui Ui) Run(build Build, ui Ui)
} }
...@@ -2,10 +2,10 @@ package plugin ...@@ -2,10 +2,10 @@ package plugin
import ( import (
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
packrpc "github.com/mitchellh/packer/packer/rpc"
"log" "log"
"net/rpc" "net/rpc"
"os/exec" "os/exec"
packrpc "github.com/mitchellh/packer/packer/rpc"
) )
type cmdBuilder struct { type cmdBuilder struct {
...@@ -39,7 +39,6 @@ func (c *cmdBuilder) checkExit(p interface{}, cb func()) { ...@@ -39,7 +39,6 @@ func (c *cmdBuilder) checkExit(p interface{}, cb func()) {
} }
} }
// Returns a valid packer.Builder where the builder is executed via RPC // Returns a valid packer.Builder where the builder is executed via RPC
// to a plugin that is within a subprocess. // to a plugin that is within a subprocess.
// //
......
...@@ -28,4 +28,3 @@ func TestBuilder_Good(t *testing.T) { ...@@ -28,4 +28,3 @@ func TestBuilder_Good(t *testing.T) {
_, err := Builder(helperProcess("builder")) _, err := Builder(helperProcess("builder"))
assert.Nil(err, "should start builder properly") assert.Nil(err, "should start builder properly")
} }
...@@ -2,10 +2,10 @@ package plugin ...@@ -2,10 +2,10 @@ package plugin
import ( import (
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
packrpc "github.com/mitchellh/packer/packer/rpc"
"log" "log"
"net/rpc" "net/rpc"
"os/exec" "os/exec"
packrpc "github.com/mitchellh/packer/packer/rpc"
) )
type cmdCommand struct { type cmdCommand struct {
......
...@@ -10,11 +10,11 @@ package plugin ...@@ -10,11 +10,11 @@ package plugin
import ( import (
"fmt" "fmt"
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
packrpc "github.com/mitchellh/packer/packer/rpc"
"log" "log"
"net" "net"
"net/rpc" "net/rpc"
"os" "os"
packrpc "github.com/mitchellh/packer/packer/rpc"
"strconv" "strconv"
"strings" "strings"
) )
......
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
"time" "time"
) )
func helperProcess(s... string) *exec.Cmd { func helperProcess(s ...string) *exec.Cmd {
cs := []string{"-test.run=TestHelperProcess", "--"} cs := []string{"-test.run=TestHelperProcess", "--"}
cs = append(cs, s...) cs = append(cs, s...)
env := []string{ env := []string{
......
...@@ -42,7 +42,7 @@ func (b *Build) Run(ui packer.Ui) { ...@@ -42,7 +42,7 @@ func (b *Build) Run(ui packer.Ui) {
b.client.Call("Build.Run", args, new(interface{})) b.client.Call("Build.Run", args, new(interface{}))
} }
func (b *BuildServer) Name(args *interface{}, reply*string) error { func (b *BuildServer) Name(args *interface{}, reply *string) error {
*reply = b.build.Name() *reply = b.build.Name()
return nil return nil
} }
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
func addrPort(address net.Addr) string { func addrPort(address net.Addr) string {
parts := strings.Split(address.String(), ":") parts := strings.Split(address.String(), ":")
return parts[len(parts) - 1] return parts[len(parts)-1]
} }
func Test_netListenerInRange(t *testing.T) { func Test_netListenerInRange(t *testing.T) {
......
...@@ -178,7 +178,7 @@ func TestTemplate_Build(t *testing.T) { ...@@ -178,7 +178,7 @@ func TestTemplate_Build(t *testing.T) {
} }
` `
expectedConfig := map[string]interface{} { expectedConfig := map[string]interface{}{
"name": "test1", "name": "test1",
"type": "test-builder", "type": "test-builder",
} }
...@@ -187,7 +187,7 @@ func TestTemplate_Build(t *testing.T) { ...@@ -187,7 +187,7 @@ func TestTemplate_Build(t *testing.T) {
assert.Nil(err, "should not error") assert.Nil(err, "should not error")
builder := testBuilder() builder := testBuilder()
builderMap := map[string]Builder { builderMap := map[string]Builder{
"test-builder": builder, "test-builder": builder,
} }
......
...@@ -8,7 +8,7 @@ import "io" ...@@ -8,7 +8,7 @@ import "io"
// is formatted and various levels of output. // is formatted and various levels of output.
type Ui interface { type Ui interface {
Say(format string, a ...interface{}) Say(format string, a ...interface{})
Error(format string, a...interface{}) Error(format string, a ...interface{})
} }
// The ReaderWriterUi is a UI that writes and reads from standard Go // The ReaderWriterUi is a UI that writes and reads from standard Go
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment