Appease redundant type from array warning

This commit is contained in:
Khosrow Moossavi
2020-04-13 13:34:11 -04:00
parent b6a6ad1bbf
commit 595c5c5dfd
5 changed files with 24 additions and 24 deletions

View File

@@ -59,7 +59,7 @@ func TestInputsSortedByPosition(t *testing.T) {
func sampleInputs() []*tfconf.Input {
return []*tfconf.Input{
&tfconf.Input{
{
Name: "e",
Type: types.String(""),
Description: types.String("description of e"),
@@ -67,7 +67,7 @@ func sampleInputs() []*tfconf.Input {
Required: false,
Position: tfconf.Position{Filename: "foo/variables.tf", Line: 35},
},
&tfconf.Input{
{
Name: "a",
Type: types.String("string"),
Description: types.String(""),
@@ -75,7 +75,7 @@ func sampleInputs() []*tfconf.Input {
Required: false,
Position: tfconf.Position{Filename: "foo/variables.tf", Line: 10},
},
&tfconf.Input{
{
Name: "d",
Type: types.String("string"),
Description: types.String("description for d"),
@@ -83,7 +83,7 @@ func sampleInputs() []*tfconf.Input {
Required: true,
Position: tfconf.Position{Filename: "foo/variables.tf", Line: 23},
},
&tfconf.Input{
{
Name: "b",
Type: types.String("number"),
Description: types.String("description of b"),
@@ -91,7 +91,7 @@ func sampleInputs() []*tfconf.Input {
Required: true,
Position: tfconf.Position{Filename: "foo/variables.tf", Line: 42},
},
&tfconf.Input{
{
Name: "c",
Type: types.String("list"),
Description: types.String("description of c"),
@@ -99,7 +99,7 @@ func sampleInputs() []*tfconf.Input {
Required: false,
Position: tfconf.Position{Filename: "foo/variables.tf", Line: 51},
},
&tfconf.Input{
{
Name: "f",
Type: types.String("string"),
Description: types.String("description of f"),

View File

@@ -43,31 +43,31 @@ func TestOutputsSortedByPosition(t *testing.T) {
func sampleOutputs() []*tfconf.Output {
return []*tfconf.Output{
&tfconf.Output{
{
Name: "a",
Description: types.String("description of a"),
Value: nil,
Position: tfconf.Position{Filename: "foo/outputs.tf", Line: 25},
},
&tfconf.Output{
{
Name: "d",
Description: types.String("description of d"),
Value: nil,
Position: tfconf.Position{Filename: "foo/outputs.tf", Line: 10},
},
&tfconf.Output{
{
Name: "e",
Description: types.String("description of e"),
Value: nil,
Position: tfconf.Position{Filename: "foo/outputs.tf", Line: 33},
},
&tfconf.Output{
{
Name: "b",
Description: types.String("description of b"),
Value: nil,
Position: tfconf.Position{Filename: "foo/outputs.tf", Line: 39},
},
&tfconf.Output{
{
Name: "c",
Description: types.String("description of c"),
Value: nil,

View File

@@ -43,43 +43,43 @@ func TestProvidersSortedByPosition(t *testing.T) {
func sampleProviders() []*tfconf.Provider {
return []*tfconf.Provider{
&tfconf.Provider{
{
Name: "d",
Alias: types.String(""),
Version: types.String("1.3.2"),
Position: tfconf.Position{Filename: "foo/main.tf", Line: 21},
},
&tfconf.Provider{
{
Name: "d",
Alias: types.String("a"),
Version: types.String("> 1.x"),
Position: tfconf.Position{Filename: "foo/main.tf", Line: 25},
},
&tfconf.Provider{
{
Name: "b",
Alias: types.String(""),
Version: types.String("= 2.1.0"),
Position: tfconf.Position{Filename: "foo/main.tf", Line: 13},
},
&tfconf.Provider{
{
Name: "a",
Alias: types.String(""),
Version: types.String(""),
Position: tfconf.Position{Filename: "foo/main.tf", Line: 39},
},
&tfconf.Provider{
{
Name: "c",
Alias: types.String(""),
Version: types.String("~> 0.5.0"),
Position: tfconf.Position{Filename: "foo/main.tf", Line: 53},
},
&tfconf.Provider{
{
Name: "e",
Alias: types.String(""),
Version: types.String(""),
Position: tfconf.Position{Filename: "foo/main.tf", Line: 47},
},
&tfconf.Provider{
{
Name: "e",
Alias: types.String("a"),
Version: types.String("> 1.0"),

View File

@@ -11,10 +11,10 @@ import (
func TestList(t *testing.T) {
values := []List{
List{"foo", "bar", "baz"},
List{"1", "2", "3"},
List{true, false, true},
List{10, float64(1000), int8(42)},
{"foo", "bar", "baz"},
{"1", "2", "3"},
{true, false, true},
{10, float64(1000), int8(42)},
}
tests := []testlist{
{

View File

@@ -37,10 +37,10 @@ func TestTemplateRender(t *testing.T) {
{
name: "template render with custom functions",
items: []*Item{
&Item{
{
Name: "all",
Text: `{{- template "section" . -}}`,
}, &Item{
}, {
Name: "section",
Text: sectionTpl,
},