fix make issues (supersedes #7868) (#7876)

* Fixing the make error or invalid data type for errorf and printf

* fix make errors
This commit is contained in:
Clint 2016-07-29 15:05:57 -05:00 committed by Paul Stack
parent 37557f9452
commit a9aaf44a87
5 changed files with 11 additions and 11 deletions

View File

@ -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 // https://github.com/boto/botocore/blob/9f322b1/botocore/data/autoscaling/2011-01-01/service-2.json#L1862-L1873
value := v.(string) value := v.(string)
if len(value) > 255 { 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 return
}, },

View File

@ -477,7 +477,7 @@ func TestExpandParameters(t *testing.T) {
} }
} }
func TestexpandRedshiftParameters(t *testing.T) { func TestExpandRedshiftParameters(t *testing.T) {
expanded := []interface{}{ expanded := []interface{}{
map[string]interface{}{ map[string]interface{}{
"name": "character_set_client", "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{}{ expanded := []interface{}{
map[string]interface{}{ map[string]interface{}{
"name": "activerehashing", "name": "activerehashing",
@ -584,7 +584,7 @@ func TestFlattenParameters(t *testing.T) {
} }
} }
func TestflattenRedshiftParameters(t *testing.T) { func TestFlattenRedshiftParameters(t *testing.T) {
cases := []struct { cases := []struct {
Input []*redshift.Parameter Input []*redshift.Parameter
Output []map[string]interface{} 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 { cases := []struct {
Input []*elasticache.Parameter Input []*elasticache.Parameter
Output []map[string]interface{} 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{ expanded := []*autoscaling.StepAdjustment{
&autoscaling.StepAdjustment{ &autoscaling.StepAdjustment{
MetricIntervalLowerBound: aws.Float64(1.0), MetricIntervalLowerBound: aws.Float64(1.0),

View File

@ -122,7 +122,7 @@ func TestValidateVarsAttribute(t *testing.T) {
func TestTemplateSharedMemoryRace(t *testing.T) { func TestTemplateSharedMemoryRace(t *testing.T) {
var wg sync.WaitGroup var wg sync.WaitGroup
for i := 0; i < 100; i++ { 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) wg.Add(1)
out, err := execute("don't panic!", map[string]interface{}{}) out, err := execute("don't panic!", map[string]interface{}{})
if err != nil { if err != nil {
@ -132,7 +132,7 @@ func TestTemplateSharedMemoryRace(t *testing.T) {
t.Fatalf("bad output: %s", out) t.Fatalf("bad output: %s", out)
} }
wg.Done() wg.Done()
}(wg, t, i) }(&wg, t, i)
} }
wg.Wait() wg.Wait()
} }

View File

@ -444,8 +444,8 @@ func TestResourceProvider_datasources(t *testing.T) {
provider := raw.(terraform.ResourceProvider) provider := raw.(terraform.ResourceProvider)
expected := []terraform.DataSource{ expected := []terraform.DataSource{
{"foo"}, {Name: "foo"},
{"bar"}, {Name: "bar"},
} }
p.DataSourcesReturn = expected p.DataSourcesReturn = expected

View File

@ -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) return nil, fmt.Errorf("Cannot parse value for variable %s (%q) as valid HCL. One value must be specified.", name, input)
default: default:
panic(fmt.Errorf("unknown type %s", targetType)) panic(fmt.Errorf("unknown type %s", targetType.Printable()))
} }
} }