From a9aaf44a87304d1ab5ae524ea34f09f6bc12624f Mon Sep 17 00:00:00 2001 From: Clint Date: Fri, 29 Jul 2016 15:05:57 -0500 Subject: [PATCH] fix make issues (supersedes #7868) (#7876) * Fixing the make error or invalid data type for errorf and printf * fix make errors --- .../aws/resource_aws_appautoscaling_policy.go | 2 +- builtin/providers/aws/structure_test.go | 10 +++++----- .../template/datasource_template_file_test.go | 4 ++-- plugin/resource_provider_test.go | 4 ++-- terraform/context.go | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/builtin/providers/aws/resource_aws_appautoscaling_policy.go b/builtin/providers/aws/resource_aws_appautoscaling_policy.go index 44461e3a7..1ce898781 100644 --- a/builtin/providers/aws/resource_aws_appautoscaling_policy.go +++ b/builtin/providers/aws/resource_aws_appautoscaling_policy.go @@ -28,7 +28,7 @@ func resourceAwsAppautoscalingPolicy() *schema.Resource { // https://github.com/boto/botocore/blob/9f322b1/botocore/data/autoscaling/2011-01-01/service-2.json#L1862-L1873 value := v.(string) if len(value) > 255 { - errors = append(errors, fmt.Errorf("q cannot be longer than 255 characters", k)) + errors = append(errors, fmt.Errorf("%s cannot be longer than 255 characters", k)) } return }, diff --git a/builtin/providers/aws/structure_test.go b/builtin/providers/aws/structure_test.go index 937411af1..d83e458a4 100644 --- a/builtin/providers/aws/structure_test.go +++ b/builtin/providers/aws/structure_test.go @@ -477,7 +477,7 @@ func TestExpandParameters(t *testing.T) { } } -func TestexpandRedshiftParameters(t *testing.T) { +func TestExpandRedshiftParameters(t *testing.T) { expanded := []interface{}{ map[string]interface{}{ "name": "character_set_client", @@ -502,7 +502,7 @@ func TestexpandRedshiftParameters(t *testing.T) { } } -func TestexpandElasticacheParameters(t *testing.T) { +func TestExpandElasticacheParameters(t *testing.T) { expanded := []interface{}{ map[string]interface{}{ "name": "activerehashing", @@ -584,7 +584,7 @@ func TestFlattenParameters(t *testing.T) { } } -func TestflattenRedshiftParameters(t *testing.T) { +func TestFlattenRedshiftParameters(t *testing.T) { cases := []struct { Input []*redshift.Parameter Output []map[string]interface{} @@ -613,7 +613,7 @@ func TestflattenRedshiftParameters(t *testing.T) { } } -func TestflattenElasticacheParameters(t *testing.T) { +func TestFlattenElasticacheParameters(t *testing.T) { cases := []struct { Input []*elasticache.Parameter Output []map[string]interface{} @@ -774,7 +774,7 @@ func TestFlattenAttachmentWhenNoInstanceId(t *testing.T) { } } -func TestflattenStepAdjustments(t *testing.T) { +func TestFlattenStepAdjustments(t *testing.T) { expanded := []*autoscaling.StepAdjustment{ &autoscaling.StepAdjustment{ MetricIntervalLowerBound: aws.Float64(1.0), diff --git a/builtin/providers/template/datasource_template_file_test.go b/builtin/providers/template/datasource_template_file_test.go index 5e82382a6..7b13f69e6 100644 --- a/builtin/providers/template/datasource_template_file_test.go +++ b/builtin/providers/template/datasource_template_file_test.go @@ -122,7 +122,7 @@ func TestValidateVarsAttribute(t *testing.T) { func TestTemplateSharedMemoryRace(t *testing.T) { var wg sync.WaitGroup for i := 0; i < 100; i++ { - go func(wg sync.WaitGroup, t *testing.T, i int) { + go func(wg *sync.WaitGroup, t *testing.T, i int) { wg.Add(1) out, err := execute("don't panic!", map[string]interface{}{}) if err != nil { @@ -132,7 +132,7 @@ func TestTemplateSharedMemoryRace(t *testing.T) { t.Fatalf("bad output: %s", out) } wg.Done() - }(wg, t, i) + }(&wg, t, i) } wg.Wait() } diff --git a/plugin/resource_provider_test.go b/plugin/resource_provider_test.go index c20662b62..41997b132 100644 --- a/plugin/resource_provider_test.go +++ b/plugin/resource_provider_test.go @@ -444,8 +444,8 @@ func TestResourceProvider_datasources(t *testing.T) { provider := raw.(terraform.ResourceProvider) expected := []terraform.DataSource{ - {"foo"}, - {"bar"}, + {Name: "foo"}, + {Name: "bar"}, } p.DataSourcesReturn = expected diff --git a/terraform/context.go b/terraform/context.go index fd83d4afe..262b7ce38 100644 --- a/terraform/context.go +++ b/terraform/context.go @@ -689,6 +689,6 @@ func parseVariableAsHCL(name string, input interface{}, targetType config.Variab return nil, fmt.Errorf("Cannot parse value for variable %s (%q) as valid HCL. One value must be specified.", name, input) default: - panic(fmt.Errorf("unknown type %s", targetType)) + panic(fmt.Errorf("unknown type %s", targetType.Printable())) } }