diff --git a/.travis.yml b/.travis.yml index 7bf4fb6db..98606817b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,7 @@ sudo: false language: go go: - - 1.9.x - - 1.10.x + - 1.11.x - master install: diff --git a/builder/amazon/ebs/builder.go b/builder/amazon/ebs/builder.go index 4655df9a5..1c698c353 100644 --- a/builder/amazon/ebs/builder.go +++ b/builder/amazon/ebs/builder.go @@ -187,9 +187,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe PrivateKeyFile: b.config.RunConfig.Comm.SSHPrivateKey, }, &awscommon.StepSecurityGroup{ - SecurityGroupIds: b.config.SecurityGroupIds, - CommConfig: &b.config.RunConfig.Comm, - VpcId: b.config.VpcId, + SecurityGroupIds: b.config.SecurityGroupIds, + CommConfig: &b.config.RunConfig.Comm, + VpcId: b.config.VpcId, TemporarySGSourceCidr: b.config.TemporarySGSourceCidr, }, &awscommon.StepCleanupVolumes{ diff --git a/builder/amazon/ebssurrogate/builder.go b/builder/amazon/ebssurrogate/builder.go index 0c76b7b7e..e5b5c7ddc 100644 --- a/builder/amazon/ebssurrogate/builder.go +++ b/builder/amazon/ebssurrogate/builder.go @@ -204,9 +204,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe PrivateKeyFile: b.config.RunConfig.Comm.SSHPrivateKey, }, &awscommon.StepSecurityGroup{ - SecurityGroupIds: b.config.SecurityGroupIds, - CommConfig: &b.config.RunConfig.Comm, - VpcId: b.config.VpcId, + SecurityGroupIds: b.config.SecurityGroupIds, + CommConfig: &b.config.RunConfig.Comm, + VpcId: b.config.VpcId, TemporarySGSourceCidr: b.config.TemporarySGSourceCidr, }, &awscommon.StepCleanupVolumes{ diff --git a/builder/amazon/ebsvolume/builder.go b/builder/amazon/ebsvolume/builder.go index 5adec5691..7529896fd 100644 --- a/builder/amazon/ebsvolume/builder.go +++ b/builder/amazon/ebsvolume/builder.go @@ -179,9 +179,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe PrivateKeyFile: b.config.RunConfig.Comm.SSHPrivateKey, }, &awscommon.StepSecurityGroup{ - SecurityGroupIds: b.config.SecurityGroupIds, - CommConfig: &b.config.RunConfig.Comm, - VpcId: b.config.VpcId, + SecurityGroupIds: b.config.SecurityGroupIds, + CommConfig: &b.config.RunConfig.Comm, + VpcId: b.config.VpcId, TemporarySGSourceCidr: b.config.TemporarySGSourceCidr, }, instanceStep, diff --git a/builder/amazon/instance/builder.go b/builder/amazon/instance/builder.go index 0164055f7..8ad791b22 100644 --- a/builder/amazon/instance/builder.go +++ b/builder/amazon/instance/builder.go @@ -265,9 +265,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe TemporaryKeyPairName: b.config.TemporaryKeyPairName, }, &awscommon.StepSecurityGroup{ - CommConfig: &b.config.RunConfig.Comm, - SecurityGroupIds: b.config.SecurityGroupIds, - VpcId: b.config.VpcId, + CommConfig: &b.config.RunConfig.Comm, + SecurityGroupIds: b.config.SecurityGroupIds, + VpcId: b.config.VpcId, TemporarySGSourceCidr: b.config.TemporarySGSourceCidr, }, instanceStep, diff --git a/builder/azure/arm/config.go b/builder/azure/arm/config.go index c0adf9ae0..5c81c5aa9 100644 --- a/builder/azure/arm/config.go +++ b/builder/azure/arm/config.go @@ -472,7 +472,7 @@ func assertTagProperties(c *Config, errs *packer.MultiError) { errs = packer.MultiErrorAppend(errs, fmt.Errorf("the tag name %q exceeds (%d) the 512 character limit", k, len(k))) } if len(*v) > 256 { - errs = packer.MultiErrorAppend(errs, fmt.Errorf("the tag name %q exceeds (%d) the 256 character limit", v, len(*v))) + errs = packer.MultiErrorAppend(errs, fmt.Errorf("the tag name %q exceeds (%d) the 256 character limit", *v, len(*v))) } } } diff --git a/builder/azure/arm/config_test.go b/builder/azure/arm/config_test.go index a52956917..343b85334 100644 --- a/builder/azure/arm/config_test.go +++ b/builder/azure/arm/config_test.go @@ -586,12 +586,12 @@ func TestConfigShouldAcceptTags(t *testing.T) { value := c.AzureTags["tag01"] if *value != "value01" { - t.Errorf("expected AzureTags[\"tag01\"] to have value \"value01\", but got %q", value) + t.Errorf("expected AzureTags[\"tag01\"] to have value \"value01\", but got %q", *value) } value = c.AzureTags["tag02"] if *value != "value02" { - t.Errorf("expected AzureTags[\"tag02\"] to have value \"value02\", but got %q", value) + t.Errorf("expected AzureTags[\"tag02\"] to have value \"value02\", but got %q", *value) } } @@ -799,7 +799,7 @@ func TestConfigShouldRejectCustomAndPlatformManagedImageBuild(t *testing.T) { func TestConfigShouldRejectCustomAndImageUrlForManagedImageBuild(t *testing.T) { config := map[string]interface{}{ - "image_url": "ignore", + "image_url": "ignore", "custom_managed_image_resource_group_name": "ignore", "custom_managed_image_name": "ignore", "location": "ignore", diff --git a/builder/azure/arm/resource_resolver.go b/builder/azure/arm/resource_resolver.go index 80c55bbb1..8b89d78af 100644 --- a/builder/azure/arm/resource_resolver.go +++ b/builder/azure/arm/resource_resolver.go @@ -24,7 +24,7 @@ type resourceResolver struct { func newResourceResolver(client *AzureClient) *resourceResolver { return &resourceResolver{ - client: client, + client: client, findVirtualNetworkResourceGroup: findVirtualNetworkResourceGroup, findVirtualNetworkSubnet: findVirtualNetworkSubnet, } diff --git a/builder/azure/arm/template_factory_test.go b/builder/azure/arm/template_factory_test.go index fcf431336..ac00d33fd 100644 --- a/builder/azure/arm/template_factory_test.go +++ b/builder/azure/arm/template_factory_test.go @@ -261,10 +261,10 @@ growpart: // Ensure the VM template is correct when building from a custom managed image. func TestVirtualMachineDeployment08(t *testing.T) { config := map[string]interface{}{ - "location": "ignore", - "subscription_id": "ignore", - "os_type": constants.Target_Linux, - "communicator": "none", + "location": "ignore", + "subscription_id": "ignore", + "os_type": constants.Target_Linux, + "communicator": "none", "custom_managed_image_resource_group_name": "CustomManagedImageResourceGroupName", "custom_managed_image_name": "CustomManagedImageName", "managed_image_name": "ManagedImageName", diff --git a/builder/azure/common/template/template_parameters_test.go b/builder/azure/common/template/template_parameters_test.go index 1c24e5bb7..9dbb9f243 100644 --- a/builder/azure/common/template/template_parameters_test.go +++ b/builder/azure/common/template/template_parameters_test.go @@ -14,8 +14,8 @@ func TestTemplateParametersShouldHaveExpectedKeys(t *testing.T) { DnsNameForPublicIP: &TemplateParameter{Value: "sentinel"}, OSDiskName: &TemplateParameter{Value: "sentinel"}, StorageAccountBlobEndpoint: &TemplateParameter{Value: "sentinel"}, - VMName: &TemplateParameter{Value: "sentinel"}, - VMSize: &TemplateParameter{Value: "sentinel"}, + VMName: &TemplateParameter{Value: "sentinel"}, + VMSize: &TemplateParameter{Value: "sentinel"}, } bs, err := json.Marshal(params) @@ -55,8 +55,8 @@ func TestParameterValuesShouldBeSet(t *testing.T) { DnsNameForPublicIP: &TemplateParameter{Value: "dnsnameforpublicip00"}, OSDiskName: &TemplateParameter{Value: "osdiskname00"}, StorageAccountBlobEndpoint: &TemplateParameter{Value: "storageaccountblobendpoint00"}, - VMName: &TemplateParameter{Value: "vmname00"}, - VMSize: &TemplateParameter{Value: "vmsize00"}, + VMName: &TemplateParameter{Value: "vmname00"}, + VMSize: &TemplateParameter{Value: "vmsize00"}, } bs, err := json.Marshal(params) diff --git a/builder/ncloud/config_test.go b/builder/ncloud/config_test.go index fb7886dbc..7ccc23478 100644 --- a/builder/ncloud/config_test.go +++ b/builder/ncloud/config_test.go @@ -7,15 +7,15 @@ import ( func testConfig() map[string]interface{} { return map[string]interface{}{ - "access_key": "access_key", - "secret_key": "secret_key", - "server_image_product_code": "SPSW0WINNT000016", - "server_product_code": "SPSVRSSD00000011", - "server_image_name": "packer-test {{timestamp}}", - "server_image_description": "server description", - "block_storage_size": 100, - "user_data": "#!/bin/sh\nyum install -y httpd\ntouch /var/www/html/index.html\nchkconfig --level 2345 httpd on", - "region": "Korea", + "access_key": "access_key", + "secret_key": "secret_key", + "server_image_product_code": "SPSW0WINNT000016", + "server_product_code": "SPSVRSSD00000011", + "server_image_name": "packer-test {{timestamp}}", + "server_image_description": "server description", + "block_storage_size": 100, + "user_data": "#!/bin/sh\nyum install -y httpd\ntouch /var/www/html/index.html\nchkconfig --level 2345 httpd on", + "region": "Korea", "access_control_group_configuration_no": "33", "communicator": "ssh", "ssh_username": "root", @@ -24,15 +24,15 @@ func testConfig() map[string]interface{} { func testConfigForMemberServerImage() map[string]interface{} { return map[string]interface{}{ - "access_key": "access_key", - "secret_key": "secret_key", - "server_product_code": "SPSVRSSD00000011", - "member_server_image_no": "2440", - "server_image_name": "packer-test {{timestamp}}", - "server_image_description": "server description", - "block_storage_size": 100, - "user_data": "#!/bin/sh\nyum install -y httpd\ntouch /var/www/html/index.html\nchkconfig --level 2345 httpd on", - "region": "Korea", + "access_key": "access_key", + "secret_key": "secret_key", + "server_product_code": "SPSVRSSD00000011", + "member_server_image_no": "2440", + "server_image_name": "packer-test {{timestamp}}", + "server_image_description": "server description", + "block_storage_size": 100, + "user_data": "#!/bin/sh\nyum install -y httpd\ntouch /var/www/html/index.html\nchkconfig --level 2345 httpd on", + "region": "Korea", "access_control_group_configuration_no": "33", "communicator": "ssh", "ssh_username": "root", diff --git a/builder/ncloud/step_create_block_storage_instance_test.go b/builder/ncloud/step_create_block_storage_instance_test.go index 6f4a9e4e2..b40e7cd64 100644 --- a/builder/ncloud/step_create_block_storage_instance_test.go +++ b/builder/ncloud/step_create_block_storage_instance_test.go @@ -12,9 +12,9 @@ func TestStepCreateBlockStorageInstanceShouldFailIfOperationCreateBlockStorageIn var testSubject = &StepCreateBlockStorageInstance{ CreateBlockStorageInstance: func(serverInstanceNo string) (string, error) { return "", fmt.Errorf("!! Unit Test FAIL !!") }, - Say: func(message string) {}, - Error: func(e error) {}, - Config: new(Config), + Say: func(message string) {}, + Error: func(e error) {}, + Config: new(Config), } testSubject.Config.BlockStorageSize = 10 @@ -35,9 +35,9 @@ func TestStepCreateBlockStorageInstanceShouldFailIfOperationCreateBlockStorageIn func TestStepCreateBlockStorageInstanceShouldPassIfOperationCreateBlockStorageInstancePasses(t *testing.T) { var testSubject = &StepCreateBlockStorageInstance{ CreateBlockStorageInstance: func(serverInstanceNo string) (string, error) { return "a", nil }, - Say: func(message string) {}, - Error: func(e error) {}, - Config: new(Config), + Say: func(message string) {}, + Error: func(e error) {}, + Config: new(Config), } testSubject.Config.BlockStorageSize = 10 diff --git a/builder/ncloud/step_delete_block_storage_instance_test.go b/builder/ncloud/step_delete_block_storage_instance_test.go index 024ed332e..9f4d6de80 100644 --- a/builder/ncloud/step_delete_block_storage_instance_test.go +++ b/builder/ncloud/step_delete_block_storage_instance_test.go @@ -11,9 +11,9 @@ import ( func TestStepDeleteBlockStorageInstanceShouldFailIfOperationDeleteBlockStorageInstanceFails(t *testing.T) { var testSubject = &StepDeleteBlockStorageInstance{ DeleteBlockStorageInstance: func(blockStorageInstanceNo string) error { return fmt.Errorf("!! Unit Test FAIL !!") }, - Say: func(message string) {}, - Error: func(e error) {}, - Config: &Config{BlockStorageSize: 10}, + Say: func(message string) {}, + Error: func(e error) {}, + Config: &Config{BlockStorageSize: 10}, } stateBag := createTestStateBagStepDeleteBlockStorageInstance() @@ -32,9 +32,9 @@ func TestStepDeleteBlockStorageInstanceShouldFailIfOperationDeleteBlockStorageIn func TestStepDeleteBlockStorageInstanceShouldPassIfOperationDeleteBlockStorageInstancePasses(t *testing.T) { var testSubject = &StepDeleteBlockStorageInstance{ DeleteBlockStorageInstance: func(blockStorageInstanceNo string) error { return nil }, - Say: func(message string) {}, - Error: func(e error) {}, - Config: &Config{BlockStorageSize: 10}, + Say: func(message string) {}, + Error: func(e error) {}, + Config: &Config{BlockStorageSize: 10}, } stateBag := createTestStateBagStepDeleteBlockStorageInstance() diff --git a/builder/ncloud/step_terminate_server_instance_test.go b/builder/ncloud/step_terminate_server_instance_test.go index 54a00748a..3db5f3ec8 100644 --- a/builder/ncloud/step_terminate_server_instance_test.go +++ b/builder/ncloud/step_terminate_server_instance_test.go @@ -11,8 +11,8 @@ import ( func TestStepTerminateServerInstanceShouldFailIfOperationTerminationFails(t *testing.T) { var testSubject = &StepTerminateServerInstance{ TerminateServerInstance: func(serverInstanceNo string) error { return fmt.Errorf("!! Unit Test FAIL !!") }, - Say: func(message string) {}, - Error: func(e error) {}, + Say: func(message string) {}, + Error: func(e error) {}, } stateBag := createTestStateBagStepTerminateServerInstance() @@ -31,8 +31,8 @@ func TestStepTerminateServerInstanceShouldFailIfOperationTerminationFails(t *tes func TestStepTerminateServerInstanceShouldPassIfOperationTerminationPasses(t *testing.T) { var testSubject = &StepTerminateServerInstance{ TerminateServerInstance: func(serverInstanceNo string) error { return nil }, - Say: func(message string) {}, - Error: func(e error) {}, + Say: func(message string) {}, + Error: func(e error) {}, } stateBag := createTestStateBagStepTerminateServerInstance() diff --git a/common/bootcommand/pc_xt_driver_test.go b/common/bootcommand/pc_xt_driver_test.go index 5133f7e85..c6216a3ea 100644 --- a/common/bootcommand/pc_xt_driver_test.go +++ b/common/bootcommand/pc_xt_driver_test.go @@ -124,21 +124,11 @@ func Test_flushes(t *testing.T) { } func Test_KeyIntervalNotGiven(t *testing.T) { - var codes []string - sendCodes := func(c []string) error { - codes = c - return nil - } - d := NewPCXTDriver(sendCodes, -1, time.Duration(0)) + d := NewPCXTDriver(nil, -1, time.Duration(0)) assert.Equal(t, d.interval, time.Duration(100)*time.Millisecond) } func Test_KeyIntervalGiven(t *testing.T) { - var codes []string - sendCodes := func(c []string) error { - codes = c - return nil - } - d := NewPCXTDriver(sendCodes, -1, time.Duration(5000)*time.Millisecond) + d := NewPCXTDriver(nil, -1, time.Duration(5000)*time.Millisecond) assert.Equal(t, d.interval, time.Duration(5000)*time.Millisecond) } diff --git a/fix/fixer_parallels_deprecations_test.go b/fix/fixer_parallels_deprecations_test.go index 648621662..22f78c122 100644 --- a/fix/fixer_parallels_deprecations_test.go +++ b/fix/fixer_parallels_deprecations_test.go @@ -28,7 +28,7 @@ func TestFixerParallelsDeprecations_Fix_parallels_tools_guest_path(t *testing.T) // parallels_tools_host_path field { Input: map[string]interface{}{ - "type": "parallels-iso", + "type": "parallels-iso", "parallels_tools_host_path": "/Path...", }, diff --git a/fix/fixer_virtualbox_gaattach_test.go b/fix/fixer_virtualbox_gaattach_test.go index f7e8285e1..b88e9325f 100644 --- a/fix/fixer_virtualbox_gaattach_test.go +++ b/fix/fixer_virtualbox_gaattach_test.go @@ -28,7 +28,7 @@ func TestFixerVirtualBoxGAAttach_Fix(t *testing.T) { // Attach field == false { Input: map[string]interface{}{ - "type": "virtualbox", + "type": "virtualbox", "guest_additions_attach": false, }, @@ -41,7 +41,7 @@ func TestFixerVirtualBoxGAAttach_Fix(t *testing.T) { // Attach field == true { Input: map[string]interface{}{ - "type": "virtualbox", + "type": "virtualbox", "guest_additions_attach": true, }, @@ -54,12 +54,12 @@ func TestFixerVirtualBoxGAAttach_Fix(t *testing.T) { // Attach field is not a bool { Input: map[string]interface{}{ - "type": "virtualbox", + "type": "virtualbox", "guest_additions_attach": "what", }, Expected: map[string]interface{}{ - "type": "virtualbox", + "type": "virtualbox", "guest_additions_attach": "what", }, }, diff --git a/helper/communicator/step_connect_ssh.go b/helper/communicator/step_connect_ssh.go index 1a501e330..7387d0ddf 100644 --- a/helper/communicator/step_connect_ssh.go +++ b/helper/communicator/step_connect_ssh.go @@ -176,9 +176,9 @@ func (s *StepConnectSSH) waitForSSH(state multistep.StateBag, cancel <-chan stru // Then we attempt to connect via SSH config := &ssh.Config{ - Connection: connFunc, - SSHConfig: sshConfig, - Pty: s.Config.SSHPty, + Connection: connFunc, + SSHConfig: sshConfig, + Pty: s.Config.SSHPty, DisableAgentForwarding: s.Config.SSHDisableAgentForwarding, UseSftp: s.Config.SSHFileTransferMethod == "sftp", KeepAliveInterval: s.Config.SSHKeepAliveInterval,