Skip to content

Commit a9aaf44

Browse files
catsbystack72
authored andcommitted
fix make issues (supersedes hashicorp#7868) (hashicorp#7876)
* Fixing the make error or invalid data type for errorf and printf * fix make errors
1 parent 37557f9 commit a9aaf44

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

builtin/providers/aws/resource_aws_appautoscaling_policy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func resourceAwsAppautoscalingPolicy() *schema.Resource {
2828
// https://github.com/boto/botocore/blob/9f322b1/botocore/data/autoscaling/2011-01-01/service-2.json#L1862-L1873
2929
value := v.(string)
3030
if len(value) > 255 {
31-
errors = append(errors, fmt.Errorf("q cannot be longer than 255 characters", k))
31+
errors = append(errors, fmt.Errorf("%s cannot be longer than 255 characters", k))
3232
}
3333
return
3434
},

builtin/providers/aws/structure_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ func TestExpandParameters(t *testing.T) {
477477
}
478478
}
479479

480-
func TestexpandRedshiftParameters(t *testing.T) {
480+
func TestExpandRedshiftParameters(t *testing.T) {
481481
expanded := []interface{}{
482482
map[string]interface{}{
483483
"name": "character_set_client",
@@ -502,7 +502,7 @@ func TestexpandRedshiftParameters(t *testing.T) {
502502
}
503503
}
504504

505-
func TestexpandElasticacheParameters(t *testing.T) {
505+
func TestExpandElasticacheParameters(t *testing.T) {
506506
expanded := []interface{}{
507507
map[string]interface{}{
508508
"name": "activerehashing",
@@ -584,7 +584,7 @@ func TestFlattenParameters(t *testing.T) {
584584
}
585585
}
586586

587-
func TestflattenRedshiftParameters(t *testing.T) {
587+
func TestFlattenRedshiftParameters(t *testing.T) {
588588
cases := []struct {
589589
Input []*redshift.Parameter
590590
Output []map[string]interface{}
@@ -613,7 +613,7 @@ func TestflattenRedshiftParameters(t *testing.T) {
613613
}
614614
}
615615

616-
func TestflattenElasticacheParameters(t *testing.T) {
616+
func TestFlattenElasticacheParameters(t *testing.T) {
617617
cases := []struct {
618618
Input []*elasticache.Parameter
619619
Output []map[string]interface{}
@@ -774,7 +774,7 @@ func TestFlattenAttachmentWhenNoInstanceId(t *testing.T) {
774774
}
775775
}
776776

777-
func TestflattenStepAdjustments(t *testing.T) {
777+
func TestFlattenStepAdjustments(t *testing.T) {
778778
expanded := []*autoscaling.StepAdjustment{
779779
&autoscaling.StepAdjustment{
780780
MetricIntervalLowerBound: aws.Float64(1.0),

builtin/providers/template/datasource_template_file_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func TestValidateVarsAttribute(t *testing.T) {
122122
func TestTemplateSharedMemoryRace(t *testing.T) {
123123
var wg sync.WaitGroup
124124
for i := 0; i < 100; i++ {
125-
go func(wg sync.WaitGroup, t *testing.T, i int) {
125+
go func(wg *sync.WaitGroup, t *testing.T, i int) {
126126
wg.Add(1)
127127
out, err := execute("don't panic!", map[string]interface{}{})
128128
if err != nil {
@@ -132,7 +132,7 @@ func TestTemplateSharedMemoryRace(t *testing.T) {
132132
t.Fatalf("bad output: %s", out)
133133
}
134134
wg.Done()
135-
}(wg, t, i)
135+
}(&wg, t, i)
136136
}
137137
wg.Wait()
138138
}

plugin/resource_provider_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,8 @@ func TestResourceProvider_datasources(t *testing.T) {
444444
provider := raw.(terraform.ResourceProvider)
445445

446446
expected := []terraform.DataSource{
447-
{"foo"},
448-
{"bar"},
447+
{Name: "foo"},
448+
{Name: "bar"},
449449
}
450450

451451
p.DataSourcesReturn = expected

terraform/context.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,6 @@ func parseVariableAsHCL(name string, input interface{}, targetType config.Variab
689689

690690
return nil, fmt.Errorf("Cannot parse value for variable %s (%q) as valid HCL. One value must be specified.", name, input)
691691
default:
692-
panic(fmt.Errorf("unknown type %s", targetType))
692+
panic(fmt.Errorf("unknown type %s", targetType.Printable()))
693693
}
694694
}

0 commit comments

Comments
 (0)