Format code with `gofmt -s -w`

This commit is contained in:
nywilken 2020-01-28 16:49:16 -05:00
parent 817957fe4f
commit d2a9e6b32e
8 changed files with 15 additions and 15 deletions

View File

@ -93,7 +93,7 @@ func TestStepRegisterAmi_buildRegisterOptsFromScratch(t *testing.T) {
FromScratch: true,
PackerConfig: common.PackerConfig{},
AMIMappings: []amazon.BlockDevice{
amazon.BlockDevice{
{
DeviceName: rootDeviceName,
},
},
@ -168,7 +168,7 @@ func TestStepRegisterAmi_buildRegisterOptFromExistingImageWithBlockDeviceMapping
FromScratch: false,
PackerConfig: common.PackerConfig{},
AMIMappings: []amazon.BlockDevice{
amazon.BlockDevice{
{
DeviceName: rootDeviceName,
},
},

View File

@ -54,7 +54,7 @@ func (s *StepAMIRegionCopy) DeduplicateRegions(intermediary bool) {
}
// Now print all those keys into the region slice again
for k, _ := range RegionMap {
for k := range RegionMap {
RegionSlice = append(RegionSlice, k)
}

View File

@ -26,7 +26,7 @@ func (m *mockEC2Conn) DescribeVpcs(input *ec2.DescribeVpcsInput) (*ec2.DescribeV
output := &ec2.DescribeVpcsOutput{
Vpcs: []*ec2.Vpc{
&ec2.Vpc{IsDefault: aws.Bool(isDefault),
{IsDefault: aws.Bool(isDefault),
VpcId: aws.String(vpcID),
},
},

View File

@ -165,12 +165,12 @@ func TestBuilderPrepare_DiskSize(t *testing.T) {
}
testCases := []testcase{
testcase{"", "40960M", false}, // not provided
testcase{"12345", "12345M", false}, // no unit given, defaults to M
testcase{"12345x", "12345x", true}, // invalid unit
testcase{"12345T", "12345T", false}, // terabytes
testcase{"12345b", "12345b", false}, // bytes get preserved when set.
testcase{"60000M", "60000M", false}, // Original test case
{"", "40960M", false}, // not provided
{"12345", "12345M", false}, // no unit given, defaults to M
{"12345x", "12345x", true}, // invalid unit
{"12345T", "12345T", false}, // terabytes
{"12345b", "12345b", false}, // bytes get preserved when set.
{"60000M", "60000M", false}, // Original test case
}
for _, tc := range testCases {
// Set input disk size

View File

@ -133,7 +133,7 @@ func (s *stepRunInstance) Run(ctx context.Context, state multistep.StateBag) mul
resourceType := "instance"
if len(tags) > 0 {
req.TagSpecification = []*cvm.TagSpecification{
&cvm.TagSpecification{
{
ResourceType: &resourceType,
Tags: tags,
},

View File

@ -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))
}
for fixer, _ := range f {
for fixer := range f {
found := false
for _, orderedFixer := range o {

View File

@ -20,7 +20,7 @@ func TestParser_complete(t *testing.T) {
parseTestArgs{"testdata/complete"},
&PackerConfig{
Sources: map[SourceRef]*Source{
refVBIsoUbuntu1204: &Source{Type: "virtualbox-iso", Name: "ubuntu-1204"},
refVBIsoUbuntu1204: {Type: "virtualbox-iso", Name: "ubuntu-1204"},
},
Builds: Builds{
&BuildBlock{

View File

@ -15,7 +15,7 @@ func TestParse_source(t *testing.T) {
parseTestArgs{"testdata/sources/basic.pkr.hcl"},
&PackerConfig{
Sources: map[SourceRef]*Source{
SourceRef{
{
Type: "virtualbox-iso",
Name: "ubuntu-1204",
}: {
@ -57,7 +57,7 @@ func TestParse_source(t *testing.T) {
parseTestArgs{"testdata/sources/duplicate.pkr.hcl"},
&PackerConfig{
Sources: map[SourceRef]*Source{
SourceRef{
{
Type: "virtualbox-iso",
Name: "ubuntu-1204",
}: {