go 1.11 format rules

This commit is contained in:
Matthew Hooker 2018-08-24 15:56:44 -07:00
parent 2d0efacbc3
commit e41e99954d
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
15 changed files with 64 additions and 64 deletions

View File

@ -187,9 +187,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
PrivateKeyFile: b.config.RunConfig.Comm.SSHPrivateKey, PrivateKeyFile: b.config.RunConfig.Comm.SSHPrivateKey,
}, },
&awscommon.StepSecurityGroup{ &awscommon.StepSecurityGroup{
SecurityGroupIds: b.config.SecurityGroupIds, SecurityGroupIds: b.config.SecurityGroupIds,
CommConfig: &b.config.RunConfig.Comm, CommConfig: &b.config.RunConfig.Comm,
VpcId: b.config.VpcId, VpcId: b.config.VpcId,
TemporarySGSourceCidr: b.config.TemporarySGSourceCidr, TemporarySGSourceCidr: b.config.TemporarySGSourceCidr,
}, },
&awscommon.StepCleanupVolumes{ &awscommon.StepCleanupVolumes{

View File

@ -204,9 +204,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
PrivateKeyFile: b.config.RunConfig.Comm.SSHPrivateKey, PrivateKeyFile: b.config.RunConfig.Comm.SSHPrivateKey,
}, },
&awscommon.StepSecurityGroup{ &awscommon.StepSecurityGroup{
SecurityGroupIds: b.config.SecurityGroupIds, SecurityGroupIds: b.config.SecurityGroupIds,
CommConfig: &b.config.RunConfig.Comm, CommConfig: &b.config.RunConfig.Comm,
VpcId: b.config.VpcId, VpcId: b.config.VpcId,
TemporarySGSourceCidr: b.config.TemporarySGSourceCidr, TemporarySGSourceCidr: b.config.TemporarySGSourceCidr,
}, },
&awscommon.StepCleanupVolumes{ &awscommon.StepCleanupVolumes{

View File

@ -179,9 +179,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
PrivateKeyFile: b.config.RunConfig.Comm.SSHPrivateKey, PrivateKeyFile: b.config.RunConfig.Comm.SSHPrivateKey,
}, },
&awscommon.StepSecurityGroup{ &awscommon.StepSecurityGroup{
SecurityGroupIds: b.config.SecurityGroupIds, SecurityGroupIds: b.config.SecurityGroupIds,
CommConfig: &b.config.RunConfig.Comm, CommConfig: &b.config.RunConfig.Comm,
VpcId: b.config.VpcId, VpcId: b.config.VpcId,
TemporarySGSourceCidr: b.config.TemporarySGSourceCidr, TemporarySGSourceCidr: b.config.TemporarySGSourceCidr,
}, },
instanceStep, instanceStep,

View File

@ -265,9 +265,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
TemporaryKeyPairName: b.config.TemporaryKeyPairName, TemporaryKeyPairName: b.config.TemporaryKeyPairName,
}, },
&awscommon.StepSecurityGroup{ &awscommon.StepSecurityGroup{
CommConfig: &b.config.RunConfig.Comm, CommConfig: &b.config.RunConfig.Comm,
SecurityGroupIds: b.config.SecurityGroupIds, SecurityGroupIds: b.config.SecurityGroupIds,
VpcId: b.config.VpcId, VpcId: b.config.VpcId,
TemporarySGSourceCidr: b.config.TemporarySGSourceCidr, TemporarySGSourceCidr: b.config.TemporarySGSourceCidr,
}, },
instanceStep, instanceStep,

View File

@ -799,7 +799,7 @@ func TestConfigShouldRejectCustomAndPlatformManagedImageBuild(t *testing.T) {
func TestConfigShouldRejectCustomAndImageUrlForManagedImageBuild(t *testing.T) { func TestConfigShouldRejectCustomAndImageUrlForManagedImageBuild(t *testing.T) {
config := map[string]interface{}{ config := map[string]interface{}{
"image_url": "ignore", "image_url": "ignore",
"custom_managed_image_resource_group_name": "ignore", "custom_managed_image_resource_group_name": "ignore",
"custom_managed_image_name": "ignore", "custom_managed_image_name": "ignore",
"location": "ignore", "location": "ignore",

View File

@ -24,7 +24,7 @@ type resourceResolver struct {
func newResourceResolver(client *AzureClient) *resourceResolver { func newResourceResolver(client *AzureClient) *resourceResolver {
return &resourceResolver{ return &resourceResolver{
client: client, client: client,
findVirtualNetworkResourceGroup: findVirtualNetworkResourceGroup, findVirtualNetworkResourceGroup: findVirtualNetworkResourceGroup,
findVirtualNetworkSubnet: findVirtualNetworkSubnet, findVirtualNetworkSubnet: findVirtualNetworkSubnet,
} }

View File

@ -261,10 +261,10 @@ growpart:
// Ensure the VM template is correct when building from a custom managed image. // Ensure the VM template is correct when building from a custom managed image.
func TestVirtualMachineDeployment08(t *testing.T) { func TestVirtualMachineDeployment08(t *testing.T) {
config := map[string]interface{}{ config := map[string]interface{}{
"location": "ignore", "location": "ignore",
"subscription_id": "ignore", "subscription_id": "ignore",
"os_type": constants.Target_Linux, "os_type": constants.Target_Linux,
"communicator": "none", "communicator": "none",
"custom_managed_image_resource_group_name": "CustomManagedImageResourceGroupName", "custom_managed_image_resource_group_name": "CustomManagedImageResourceGroupName",
"custom_managed_image_name": "CustomManagedImageName", "custom_managed_image_name": "CustomManagedImageName",
"managed_image_name": "ManagedImageName", "managed_image_name": "ManagedImageName",

View File

@ -14,8 +14,8 @@ func TestTemplateParametersShouldHaveExpectedKeys(t *testing.T) {
DnsNameForPublicIP: &TemplateParameter{Value: "sentinel"}, DnsNameForPublicIP: &TemplateParameter{Value: "sentinel"},
OSDiskName: &TemplateParameter{Value: "sentinel"}, OSDiskName: &TemplateParameter{Value: "sentinel"},
StorageAccountBlobEndpoint: &TemplateParameter{Value: "sentinel"}, StorageAccountBlobEndpoint: &TemplateParameter{Value: "sentinel"},
VMName: &TemplateParameter{Value: "sentinel"}, VMName: &TemplateParameter{Value: "sentinel"},
VMSize: &TemplateParameter{Value: "sentinel"}, VMSize: &TemplateParameter{Value: "sentinel"},
} }
bs, err := json.Marshal(params) bs, err := json.Marshal(params)
@ -55,8 +55,8 @@ func TestParameterValuesShouldBeSet(t *testing.T) {
DnsNameForPublicIP: &TemplateParameter{Value: "dnsnameforpublicip00"}, DnsNameForPublicIP: &TemplateParameter{Value: "dnsnameforpublicip00"},
OSDiskName: &TemplateParameter{Value: "osdiskname00"}, OSDiskName: &TemplateParameter{Value: "osdiskname00"},
StorageAccountBlobEndpoint: &TemplateParameter{Value: "storageaccountblobendpoint00"}, StorageAccountBlobEndpoint: &TemplateParameter{Value: "storageaccountblobendpoint00"},
VMName: &TemplateParameter{Value: "vmname00"}, VMName: &TemplateParameter{Value: "vmname00"},
VMSize: &TemplateParameter{Value: "vmsize00"}, VMSize: &TemplateParameter{Value: "vmsize00"},
} }
bs, err := json.Marshal(params) bs, err := json.Marshal(params)

View File

@ -7,15 +7,15 @@ import (
func testConfig() map[string]interface{} { func testConfig() map[string]interface{} {
return map[string]interface{}{ return map[string]interface{}{
"access_key": "access_key", "access_key": "access_key",
"secret_key": "secret_key", "secret_key": "secret_key",
"server_image_product_code": "SPSW0WINNT000016", "server_image_product_code": "SPSW0WINNT000016",
"server_product_code": "SPSVRSSD00000011", "server_product_code": "SPSVRSSD00000011",
"server_image_name": "packer-test {{timestamp}}", "server_image_name": "packer-test {{timestamp}}",
"server_image_description": "server description", "server_image_description": "server description",
"block_storage_size": 100, "block_storage_size": 100,
"user_data": "#!/bin/sh\nyum install -y httpd\ntouch /var/www/html/index.html\nchkconfig --level 2345 httpd on", "user_data": "#!/bin/sh\nyum install -y httpd\ntouch /var/www/html/index.html\nchkconfig --level 2345 httpd on",
"region": "Korea", "region": "Korea",
"access_control_group_configuration_no": "33", "access_control_group_configuration_no": "33",
"communicator": "ssh", "communicator": "ssh",
"ssh_username": "root", "ssh_username": "root",
@ -24,15 +24,15 @@ func testConfig() map[string]interface{} {
func testConfigForMemberServerImage() map[string]interface{} { func testConfigForMemberServerImage() map[string]interface{} {
return map[string]interface{}{ return map[string]interface{}{
"access_key": "access_key", "access_key": "access_key",
"secret_key": "secret_key", "secret_key": "secret_key",
"server_product_code": "SPSVRSSD00000011", "server_product_code": "SPSVRSSD00000011",
"member_server_image_no": "2440", "member_server_image_no": "2440",
"server_image_name": "packer-test {{timestamp}}", "server_image_name": "packer-test {{timestamp}}",
"server_image_description": "server description", "server_image_description": "server description",
"block_storage_size": 100, "block_storage_size": 100,
"user_data": "#!/bin/sh\nyum install -y httpd\ntouch /var/www/html/index.html\nchkconfig --level 2345 httpd on", "user_data": "#!/bin/sh\nyum install -y httpd\ntouch /var/www/html/index.html\nchkconfig --level 2345 httpd on",
"region": "Korea", "region": "Korea",
"access_control_group_configuration_no": "33", "access_control_group_configuration_no": "33",
"communicator": "ssh", "communicator": "ssh",
"ssh_username": "root", "ssh_username": "root",

View File

@ -12,9 +12,9 @@ func TestStepCreateBlockStorageInstanceShouldFailIfOperationCreateBlockStorageIn
var testSubject = &StepCreateBlockStorageInstance{ var testSubject = &StepCreateBlockStorageInstance{
CreateBlockStorageInstance: func(serverInstanceNo string) (string, error) { return "", fmt.Errorf("!! Unit Test FAIL !!") }, CreateBlockStorageInstance: func(serverInstanceNo string) (string, error) { return "", fmt.Errorf("!! Unit Test FAIL !!") },
Say: func(message string) {}, Say: func(message string) {},
Error: func(e error) {}, Error: func(e error) {},
Config: new(Config), Config: new(Config),
} }
testSubject.Config.BlockStorageSize = 10 testSubject.Config.BlockStorageSize = 10
@ -35,9 +35,9 @@ func TestStepCreateBlockStorageInstanceShouldFailIfOperationCreateBlockStorageIn
func TestStepCreateBlockStorageInstanceShouldPassIfOperationCreateBlockStorageInstancePasses(t *testing.T) { func TestStepCreateBlockStorageInstanceShouldPassIfOperationCreateBlockStorageInstancePasses(t *testing.T) {
var testSubject = &StepCreateBlockStorageInstance{ var testSubject = &StepCreateBlockStorageInstance{
CreateBlockStorageInstance: func(serverInstanceNo string) (string, error) { return "a", nil }, CreateBlockStorageInstance: func(serverInstanceNo string) (string, error) { return "a", nil },
Say: func(message string) {}, Say: func(message string) {},
Error: func(e error) {}, Error: func(e error) {},
Config: new(Config), Config: new(Config),
} }
testSubject.Config.BlockStorageSize = 10 testSubject.Config.BlockStorageSize = 10

View File

@ -11,9 +11,9 @@ import (
func TestStepDeleteBlockStorageInstanceShouldFailIfOperationDeleteBlockStorageInstanceFails(t *testing.T) { func TestStepDeleteBlockStorageInstanceShouldFailIfOperationDeleteBlockStorageInstanceFails(t *testing.T) {
var testSubject = &StepDeleteBlockStorageInstance{ var testSubject = &StepDeleteBlockStorageInstance{
DeleteBlockStorageInstance: func(blockStorageInstanceNo string) error { return fmt.Errorf("!! Unit Test FAIL !!") }, DeleteBlockStorageInstance: func(blockStorageInstanceNo string) error { return fmt.Errorf("!! Unit Test FAIL !!") },
Say: func(message string) {}, Say: func(message string) {},
Error: func(e error) {}, Error: func(e error) {},
Config: &Config{BlockStorageSize: 10}, Config: &Config{BlockStorageSize: 10},
} }
stateBag := createTestStateBagStepDeleteBlockStorageInstance() stateBag := createTestStateBagStepDeleteBlockStorageInstance()
@ -32,9 +32,9 @@ func TestStepDeleteBlockStorageInstanceShouldFailIfOperationDeleteBlockStorageIn
func TestStepDeleteBlockStorageInstanceShouldPassIfOperationDeleteBlockStorageInstancePasses(t *testing.T) { func TestStepDeleteBlockStorageInstanceShouldPassIfOperationDeleteBlockStorageInstancePasses(t *testing.T) {
var testSubject = &StepDeleteBlockStorageInstance{ var testSubject = &StepDeleteBlockStorageInstance{
DeleteBlockStorageInstance: func(blockStorageInstanceNo string) error { return nil }, DeleteBlockStorageInstance: func(blockStorageInstanceNo string) error { return nil },
Say: func(message string) {}, Say: func(message string) {},
Error: func(e error) {}, Error: func(e error) {},
Config: &Config{BlockStorageSize: 10}, Config: &Config{BlockStorageSize: 10},
} }
stateBag := createTestStateBagStepDeleteBlockStorageInstance() stateBag := createTestStateBagStepDeleteBlockStorageInstance()

View File

@ -11,8 +11,8 @@ import (
func TestStepTerminateServerInstanceShouldFailIfOperationTerminationFails(t *testing.T) { func TestStepTerminateServerInstanceShouldFailIfOperationTerminationFails(t *testing.T) {
var testSubject = &StepTerminateServerInstance{ var testSubject = &StepTerminateServerInstance{
TerminateServerInstance: func(serverInstanceNo string) error { return fmt.Errorf("!! Unit Test FAIL !!") }, TerminateServerInstance: func(serverInstanceNo string) error { return fmt.Errorf("!! Unit Test FAIL !!") },
Say: func(message string) {}, Say: func(message string) {},
Error: func(e error) {}, Error: func(e error) {},
} }
stateBag := createTestStateBagStepTerminateServerInstance() stateBag := createTestStateBagStepTerminateServerInstance()
@ -31,8 +31,8 @@ func TestStepTerminateServerInstanceShouldFailIfOperationTerminationFails(t *tes
func TestStepTerminateServerInstanceShouldPassIfOperationTerminationPasses(t *testing.T) { func TestStepTerminateServerInstanceShouldPassIfOperationTerminationPasses(t *testing.T) {
var testSubject = &StepTerminateServerInstance{ var testSubject = &StepTerminateServerInstance{
TerminateServerInstance: func(serverInstanceNo string) error { return nil }, TerminateServerInstance: func(serverInstanceNo string) error { return nil },
Say: func(message string) {}, Say: func(message string) {},
Error: func(e error) {}, Error: func(e error) {},
} }
stateBag := createTestStateBagStepTerminateServerInstance() stateBag := createTestStateBagStepTerminateServerInstance()

View File

@ -28,7 +28,7 @@ func TestFixerParallelsDeprecations_Fix_parallels_tools_guest_path(t *testing.T)
// parallels_tools_host_path field // parallels_tools_host_path field
{ {
Input: map[string]interface{}{ Input: map[string]interface{}{
"type": "parallels-iso", "type": "parallels-iso",
"parallels_tools_host_path": "/Path...", "parallels_tools_host_path": "/Path...",
}, },

View File

@ -28,7 +28,7 @@ func TestFixerVirtualBoxGAAttach_Fix(t *testing.T) {
// Attach field == false // Attach field == false
{ {
Input: map[string]interface{}{ Input: map[string]interface{}{
"type": "virtualbox", "type": "virtualbox",
"guest_additions_attach": false, "guest_additions_attach": false,
}, },
@ -41,7 +41,7 @@ func TestFixerVirtualBoxGAAttach_Fix(t *testing.T) {
// Attach field == true // Attach field == true
{ {
Input: map[string]interface{}{ Input: map[string]interface{}{
"type": "virtualbox", "type": "virtualbox",
"guest_additions_attach": true, "guest_additions_attach": true,
}, },
@ -54,12 +54,12 @@ func TestFixerVirtualBoxGAAttach_Fix(t *testing.T) {
// Attach field is not a bool // Attach field is not a bool
{ {
Input: map[string]interface{}{ Input: map[string]interface{}{
"type": "virtualbox", "type": "virtualbox",
"guest_additions_attach": "what", "guest_additions_attach": "what",
}, },
Expected: map[string]interface{}{ Expected: map[string]interface{}{
"type": "virtualbox", "type": "virtualbox",
"guest_additions_attach": "what", "guest_additions_attach": "what",
}, },
}, },

View File

@ -176,9 +176,9 @@ func (s *StepConnectSSH) waitForSSH(state multistep.StateBag, cancel <-chan stru
// Then we attempt to connect via SSH // Then we attempt to connect via SSH
config := &ssh.Config{ config := &ssh.Config{
Connection: connFunc, Connection: connFunc,
SSHConfig: sshConfig, SSHConfig: sshConfig,
Pty: s.Config.SSHPty, Pty: s.Config.SSHPty,
DisableAgentForwarding: s.Config.SSHDisableAgentForwarding, DisableAgentForwarding: s.Config.SSHDisableAgentForwarding,
UseSftp: s.Config.SSHFileTransferMethod == "sftp", UseSftp: s.Config.SSHFileTransferMethod == "sftp",
KeepAliveInterval: s.Config.SSHKeepAliveInterval, KeepAliveInterval: s.Config.SSHKeepAliveInterval,