Updates after running `make fmt` with Go v1.11.1

This commit is contained in:
Sander van Harmelen 2018-10-17 23:05:57 +02:00 committed by Martin Atkins
parent 02e135bac8
commit 48ef7ecfa6
7 changed files with 14 additions and 15 deletions

View File

@ -1,12 +1,11 @@
package local package local
import ( import (
"log"
"context" "context"
"fmt" "fmt"
"log"
"github.com/hashicorp/errwrap" "github.com/hashicorp/errwrap"
"github.com/hashicorp/terraform/backend" "github.com/hashicorp/terraform/backend"
"github.com/hashicorp/terraform/command/clistate" "github.com/hashicorp/terraform/command/clistate"
"github.com/hashicorp/terraform/configs/configload" "github.com/hashicorp/terraform/configs/configload"

View File

@ -254,8 +254,8 @@ func TestBackendPrefixInWorkspace(t *testing.T) {
bucketName := fmt.Sprintf("terraform-remote-s3-test-%x", time.Now().Unix()) bucketName := fmt.Sprintf("terraform-remote-s3-test-%x", time.Now().Unix())
b := backend.TestBackendConfig(t, New(), backend.TestWrapConfig(map[string]interface{}{ b := backend.TestBackendConfig(t, New(), backend.TestWrapConfig(map[string]interface{}{
"bucket": bucketName, "bucket": bucketName,
"key": "test-env.tfstate", "key": "test-env.tfstate",
"workspace_key_prefix": "env", "workspace_key_prefix": "env",
})).(*Backend) })).(*Backend)

View File

@ -8,7 +8,7 @@ import (
) )
func TestObjectValueIDOrName(t *testing.T) { func TestObjectValueIDOrName(t *testing.T) {
tests := []struct{ tests := []struct {
obj cty.Value obj cty.Value
id [2]string id [2]string
name [2]string name [2]string
@ -34,7 +34,7 @@ func TestObjectValueIDOrName(t *testing.T) {
}, },
{ {
cty.ObjectVal(map[string]cty.Value{ cty.ObjectVal(map[string]cty.Value{
"id": cty.StringVal("foo-123"), "id": cty.StringVal("foo-123"),
}), }),
[...]string{"id", "foo-123"}, [...]string{"id", "foo-123"},
[...]string{"", ""}, [...]string{"", ""},
@ -95,7 +95,7 @@ func TestObjectValueIDOrName(t *testing.T) {
// in this formatter, this is the place to add a new test case. // in this formatter, this is the place to add a new test case.
{ {
cty.ObjectVal(map[string]cty.Value{ cty.ObjectVal(map[string]cty.Value{
"id": cty.True, "id": cty.True,
}), }),
[...]string{"", ""}, [...]string{"", ""},
[...]string{"", ""}, [...]string{"", ""},
@ -103,7 +103,7 @@ func TestObjectValueIDOrName(t *testing.T) {
}, },
{ {
cty.ObjectVal(map[string]cty.Value{ cty.ObjectVal(map[string]cty.Value{
"id": cty.NullVal(cty.String), "id": cty.NullVal(cty.String),
}), }),
[...]string{"", ""}, [...]string{"", ""},
[...]string{"", ""}, [...]string{"", ""},
@ -111,7 +111,7 @@ func TestObjectValueIDOrName(t *testing.T) {
}, },
{ {
cty.ObjectVal(map[string]cty.Value{ cty.ObjectVal(map[string]cty.Value{
"id": cty.UnknownVal(cty.String), "id": cty.UnknownVal(cty.String),
}), }),
[...]string{"", ""}, [...]string{"", ""},
[...]string{"", ""}, [...]string{"", ""},
@ -174,7 +174,7 @@ func TestObjectValueIDOrName(t *testing.T) {
} }
for _, test := range tests { for _, test := range tests {
t.Run(fmt.Sprintf("%#v", test.obj), func (t *testing.T) { t.Run(fmt.Sprintf("%#v", test.obj), func(t *testing.T) {
obj := test.obj obj := test.obj
gotIDKey, gotIDVal := ObjectValueID(obj) gotIDKey, gotIDVal := ObjectValueID(obj)
gotNameKey, gotNameVal := ObjectValueName(obj) gotNameKey, gotNameVal := ObjectValueName(obj)

View File

@ -5,13 +5,13 @@ import (
"net" "net"
"time" "time"
"google.golang.org/grpc/test/bufconn"
"github.com/hashicorp/terraform/helper/plugin" "github.com/hashicorp/terraform/helper/plugin"
tfplugin "github.com/hashicorp/terraform/plugin" tfplugin "github.com/hashicorp/terraform/plugin"
"github.com/hashicorp/terraform/plugin/proto" "github.com/hashicorp/terraform/plugin/proto"
"github.com/hashicorp/terraform/providers" "github.com/hashicorp/terraform/providers"
"github.com/hashicorp/terraform/terraform" "github.com/hashicorp/terraform/terraform"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/test/bufconn"
) )
// GRPCTestProvider takes a legacy ResourceProvider, wraps it in the new GRPC // GRPCTestProvider takes a legacy ResourceProvider, wraps it in the new GRPC

View File

@ -1,9 +1,9 @@
package resource package resource
import ( import (
"errors"
"bufio" "bufio"
"bytes" "bytes"
"errors"
"fmt" "fmt"
"log" "log"
"sort" "sort"

View File

@ -297,7 +297,7 @@ func WholeContainingBody(severity Severity, summary, detail string) Diagnostic {
type wholeBodyDiagnostic struct { type wholeBodyDiagnostic struct {
diagnosticBase diagnosticBase
subject *SourceRange // populated only after ElaborateFromConfigBody subject *SourceRange // populated only after ElaborateFromConfigBody
} }
func (d *wholeBodyDiagnostic) ElaborateFromConfigBody(body hcl.Body) Diagnostic { func (d *wholeBodyDiagnostic) ElaborateFromConfigBody(body hcl.Body) Diagnostic {