From 5c5d62733f25756ec38d8606b91ff1030d144758 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 1 May 2014 14:24:19 -0700 Subject: [PATCH] fmt --- builder/digitalocean/builder.go | 10 +++++----- builder/parallels/iso/step_attach_iso.go | 2 +- builder/parallels/iso/step_create_disk.go | 2 +- builder/parallels/pvm/step_test.go | 2 +- common/config.go | 4 ++-- packer/template.go | 4 ++-- provisioner/chef-solo/provisioner_test.go | 8 ++++---- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/builder/digitalocean/builder.go b/builder/digitalocean/builder.go index d07bb0e52..670f8ed77 100644 --- a/builder/digitalocean/builder.go +++ b/builder/digitalocean/builder.go @@ -17,7 +17,7 @@ import ( // see https://api.digitalocean.com/images/?client_id=[client_id]&api_key=[api_key] // name="Ubuntu 12.04.4 x64", id=3101045, -const DefaultImage = "ubuntu-12-04-x64" +const DefaultImage = "ubuntu-12-04-x64" // see https://api.digitalocean.com/regions/?client_id=[client_id]&api_key=[api_key] // name="New York", id=1 @@ -25,7 +25,7 @@ const DefaultRegion = "nyc1" // see https://api.digitalocean.com/sizes/?client_id=[client_id]&api_key=[api_key] // name="512MB", id=66 (the smallest droplet size) -const DefaultSize = "512mb" +const DefaultSize = "512mb" // The unique id for the builder const BuilderId = "pearkes.digitalocean" @@ -42,9 +42,9 @@ type config struct { SizeID uint `mapstructure:"size_id"` ImageID uint `mapstructure:"image_id"` - Region string `mapstructure:"region"` - Size string `mapstructure:"size"` - Image string `mapstructure:"image"` + Region string `mapstructure:"region"` + Size string `mapstructure:"size"` + Image string `mapstructure:"image"` PrivateNetworking bool `mapstructure:"private_networking"` SnapshotName string `mapstructure:"snapshot_name"` diff --git a/builder/parallels/iso/step_attach_iso.go b/builder/parallels/iso/step_attach_iso.go index c18143409..c4937217c 100644 --- a/builder/parallels/iso/step_attach_iso.go +++ b/builder/parallels/iso/step_attach_iso.go @@ -3,8 +3,8 @@ package iso import ( "fmt" "github.com/mitchellh/multistep" - "github.com/mitchellh/packer/packer" parallelscommon "github.com/mitchellh/packer/builder/parallels/common" + "github.com/mitchellh/packer/packer" ) // This step attaches the ISO to the virtual machine. diff --git a/builder/parallels/iso/step_create_disk.go b/builder/parallels/iso/step_create_disk.go index 7571abce3..abb6ec2aa 100644 --- a/builder/parallels/iso/step_create_disk.go +++ b/builder/parallels/iso/step_create_disk.go @@ -3,8 +3,8 @@ package iso import ( "fmt" "github.com/mitchellh/multistep" - "github.com/mitchellh/packer/packer" parallelscommon "github.com/mitchellh/packer/builder/parallels/common" + "github.com/mitchellh/packer/packer" "strconv" ) diff --git a/builder/parallels/pvm/step_test.go b/builder/parallels/pvm/step_test.go index 9a5fd6e38..15d76de5b 100644 --- a/builder/parallels/pvm/step_test.go +++ b/builder/parallels/pvm/step_test.go @@ -3,8 +3,8 @@ package pvm import ( "bytes" "github.com/mitchellh/multistep" - "github.com/mitchellh/packer/packer" parallelscommon "github.com/mitchellh/packer/builder/parallels/common" + "github.com/mitchellh/packer/packer" "testing" ) diff --git a/common/config.go b/common/config.go index 0fe5ffc99..4a56cc356 100644 --- a/common/config.go +++ b/common/config.go @@ -68,7 +68,7 @@ func DecodeConfig(target interface{}, raws ...interface{}) (*mapstructure.Metada var md mapstructure.Metadata decoderConfig := &mapstructure.DecoderConfig{ - DecodeHook: mapstructure.ComposeDecodeHookFunc( + DecodeHook: mapstructure.ComposeDecodeHookFunc( decodeHook, mapstructure.StringToSliceHookFunc(","), ), @@ -221,7 +221,7 @@ func decodeConfigHook(raws []interface{}) (mapstructure.DecodeHookFunc, error) { // because internally Packer uses MsgPack for RPC and the MsgPack // codec turns strings into []uint8 if f == reflect.Slice { - dataVal := reflect.ValueOf(v) + dataVal := reflect.ValueOf(v) dataType := dataVal.Type() elemKind := dataType.Elem().Kind() if elemKind == reflect.Uint8 { diff --git a/packer/template.go b/packer/template.go index a96b6758d..ed71e90d6 100644 --- a/packer/template.go +++ b/packer/template.go @@ -131,8 +131,8 @@ func ParseTemplate(data []byte, vars map[string]string) (t *Template, err error) if vCur.LessThan(vReq) { return nil, fmt.Errorf( - "Template requires Packer version %s. " + - "Running version is %s.", + "Template requires Packer version %s. "+ + "Running version is %s.", vReq, vCur) } } diff --git a/provisioner/chef-solo/provisioner_test.go b/provisioner/chef-solo/provisioner_test.go index 73e54de57..67fc1009a 100644 --- a/provisioner/chef-solo/provisioner_test.go +++ b/provisioner/chef-solo/provisioner_test.go @@ -279,11 +279,11 @@ func TestProvisionerPrepare_jsonNested(t *testing.T) { }, "bFalse": false, - "bTrue": true, - "bNil": nil, - "bStr": []uint8("bar"), + "bTrue": true, + "bNil": nil, + "bStr": []uint8("bar"), - "bInt": 1, + "bInt": 1, "bFloat": 4.5, }