Format code with `gofmt -s -w`
This commit is contained in:
parent
817957fe4f
commit
d2a9e6b32e
|
@ -93,7 +93,7 @@ func TestStepRegisterAmi_buildRegisterOptsFromScratch(t *testing.T) {
|
||||||
FromScratch: true,
|
FromScratch: true,
|
||||||
PackerConfig: common.PackerConfig{},
|
PackerConfig: common.PackerConfig{},
|
||||||
AMIMappings: []amazon.BlockDevice{
|
AMIMappings: []amazon.BlockDevice{
|
||||||
amazon.BlockDevice{
|
{
|
||||||
DeviceName: rootDeviceName,
|
DeviceName: rootDeviceName,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -168,7 +168,7 @@ func TestStepRegisterAmi_buildRegisterOptFromExistingImageWithBlockDeviceMapping
|
||||||
FromScratch: false,
|
FromScratch: false,
|
||||||
PackerConfig: common.PackerConfig{},
|
PackerConfig: common.PackerConfig{},
|
||||||
AMIMappings: []amazon.BlockDevice{
|
AMIMappings: []amazon.BlockDevice{
|
||||||
amazon.BlockDevice{
|
{
|
||||||
DeviceName: rootDeviceName,
|
DeviceName: rootDeviceName,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -54,7 +54,7 @@ func (s *StepAMIRegionCopy) DeduplicateRegions(intermediary bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now print all those keys into the region slice again
|
// Now print all those keys into the region slice again
|
||||||
for k, _ := range RegionMap {
|
for k := range RegionMap {
|
||||||
RegionSlice = append(RegionSlice, k)
|
RegionSlice = append(RegionSlice, k)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ func (m *mockEC2Conn) DescribeVpcs(input *ec2.DescribeVpcsInput) (*ec2.DescribeV
|
||||||
|
|
||||||
output := &ec2.DescribeVpcsOutput{
|
output := &ec2.DescribeVpcsOutput{
|
||||||
Vpcs: []*ec2.Vpc{
|
Vpcs: []*ec2.Vpc{
|
||||||
&ec2.Vpc{IsDefault: aws.Bool(isDefault),
|
{IsDefault: aws.Bool(isDefault),
|
||||||
VpcId: aws.String(vpcID),
|
VpcId: aws.String(vpcID),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -165,12 +165,12 @@ func TestBuilderPrepare_DiskSize(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
testCases := []testcase{
|
testCases := []testcase{
|
||||||
testcase{"", "40960M", false}, // not provided
|
{"", "40960M", false}, // not provided
|
||||||
testcase{"12345", "12345M", false}, // no unit given, defaults to M
|
{"12345", "12345M", false}, // no unit given, defaults to M
|
||||||
testcase{"12345x", "12345x", true}, // invalid unit
|
{"12345x", "12345x", true}, // invalid unit
|
||||||
testcase{"12345T", "12345T", false}, // terabytes
|
{"12345T", "12345T", false}, // terabytes
|
||||||
testcase{"12345b", "12345b", false}, // bytes get preserved when set.
|
{"12345b", "12345b", false}, // bytes get preserved when set.
|
||||||
testcase{"60000M", "60000M", false}, // Original test case
|
{"60000M", "60000M", false}, // Original test case
|
||||||
}
|
}
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
// Set input disk size
|
// Set input disk size
|
||||||
|
|
|
@ -133,7 +133,7 @@ func (s *stepRunInstance) Run(ctx context.Context, state multistep.StateBag) mul
|
||||||
resourceType := "instance"
|
resourceType := "instance"
|
||||||
if len(tags) > 0 {
|
if len(tags) > 0 {
|
||||||
req.TagSpecification = []*cvm.TagSpecification{
|
req.TagSpecification = []*cvm.TagSpecification{
|
||||||
&cvm.TagSpecification{
|
{
|
||||||
ResourceType: &resourceType,
|
ResourceType: &resourceType,
|
||||||
Tags: tags,
|
Tags: tags,
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,7 +12,7 @@ func TestFix_allFixersEnabled(t *testing.T) {
|
||||||
t.Fatalf("Fixers length (%d) does not match FixerOrder length (%d)", len(f), len(o))
|
t.Fatalf("Fixers length (%d) does not match FixerOrder length (%d)", len(f), len(o))
|
||||||
}
|
}
|
||||||
|
|
||||||
for fixer, _ := range f {
|
for fixer := range f {
|
||||||
found := false
|
found := false
|
||||||
|
|
||||||
for _, orderedFixer := range o {
|
for _, orderedFixer := range o {
|
||||||
|
|
|
@ -20,7 +20,7 @@ func TestParser_complete(t *testing.T) {
|
||||||
parseTestArgs{"testdata/complete"},
|
parseTestArgs{"testdata/complete"},
|
||||||
&PackerConfig{
|
&PackerConfig{
|
||||||
Sources: map[SourceRef]*Source{
|
Sources: map[SourceRef]*Source{
|
||||||
refVBIsoUbuntu1204: &Source{Type: "virtualbox-iso", Name: "ubuntu-1204"},
|
refVBIsoUbuntu1204: {Type: "virtualbox-iso", Name: "ubuntu-1204"},
|
||||||
},
|
},
|
||||||
Builds: Builds{
|
Builds: Builds{
|
||||||
&BuildBlock{
|
&BuildBlock{
|
||||||
|
|
|
@ -15,7 +15,7 @@ func TestParse_source(t *testing.T) {
|
||||||
parseTestArgs{"testdata/sources/basic.pkr.hcl"},
|
parseTestArgs{"testdata/sources/basic.pkr.hcl"},
|
||||||
&PackerConfig{
|
&PackerConfig{
|
||||||
Sources: map[SourceRef]*Source{
|
Sources: map[SourceRef]*Source{
|
||||||
SourceRef{
|
{
|
||||||
Type: "virtualbox-iso",
|
Type: "virtualbox-iso",
|
||||||
Name: "ubuntu-1204",
|
Name: "ubuntu-1204",
|
||||||
}: {
|
}: {
|
||||||
|
@ -57,7 +57,7 @@ func TestParse_source(t *testing.T) {
|
||||||
parseTestArgs{"testdata/sources/duplicate.pkr.hcl"},
|
parseTestArgs{"testdata/sources/duplicate.pkr.hcl"},
|
||||||
&PackerConfig{
|
&PackerConfig{
|
||||||
Sources: map[SourceRef]*Source{
|
Sources: map[SourceRef]*Source{
|
||||||
SourceRef{
|
{
|
||||||
Type: "virtualbox-iso",
|
Type: "virtualbox-iso",
|
||||||
Name: "ubuntu-1204",
|
Name: "ubuntu-1204",
|
||||||
}: {
|
}: {
|
||||||
|
|
Loading…
Reference in New Issue