diff --git a/diag/helpers.go b/diag/helpers.go index d43eab3249f..08e9291784d 100644 --- a/diag/helpers.go +++ b/diag/helpers.go @@ -6,9 +6,9 @@ import "fmt" // as the most common use case in Go will be handling a single error // returned from a function. // -// if err != nil { -// return diag.FromErr(err) -// } +// if err != nil { +// return diag.FromErr(err) +// } func FromErr(err error) Diagnostics { if err == nil { return nil @@ -26,9 +26,9 @@ func FromErr(err error) Diagnostics { // values. This returns a single error in a Diagnostics as errors typically // do not occur in multiples as warnings may. // -// if unexpectedCondition { -// return diag.Errorf("unexpected: %s", someValue) -// } +// if unexpectedCondition { +// return diag.Errorf("unexpected: %s", someValue) +// } func Errorf(format string, a ...interface{}) Diagnostics { return Diagnostics{ Diagnostic{ diff --git a/helper/customdiff/compose.go b/helper/customdiff/compose.go index 9b1b929d0f9..5f2e71b5dda 100644 --- a/helper/customdiff/compose.go +++ b/helper/customdiff/compose.go @@ -18,32 +18,31 @@ import ( // // For example: // -// &schema.Resource{ -// // ... -// CustomizeDiff: customdiff.All( -// customdiff.ValidateChange("size", func (old, new, meta interface{}) error { -// // If we are increasing "size" then the new value must be -// // a multiple of the old value. -// if new.(int) <= old.(int) { -// return nil -// } -// if (new.(int) % old.(int)) != 0 { -// return fmt.Errorf("new size value must be an integer multiple of old value %d", old.(int)) -// } -// return nil -// }), -// customdiff.ForceNewIfChange("size", func (old, new, meta interface{}) bool { -// // "size" can only increase in-place, so we must create a new resource -// // if it is decreased. -// return new.(int) < old.(int) -// }), -// customdiff.ComputedIf("version_id", func (d *schema.ResourceDiff, meta interface{}) bool { -// // Any change to "content" causes a new "version_id" to be allocated. -// return d.HasChange("content") -// }), -// ), -// } -// +// &schema.Resource{ +// // ... +// CustomizeDiff: customdiff.All( +// customdiff.ValidateChange("size", func (old, new, meta interface{}) error { +// // If we are increasing "size" then the new value must be +// // a multiple of the old value. +// if new.(int) <= old.(int) { +// return nil +// } +// if (new.(int) % old.(int)) != 0 { +// return fmt.Errorf("new size value must be an integer multiple of old value %d", old.(int)) +// } +// return nil +// }), +// customdiff.ForceNewIfChange("size", func (old, new, meta interface{}) bool { +// // "size" can only increase in-place, so we must create a new resource +// // if it is decreased. +// return new.(int) < old.(int) +// }), +// customdiff.ComputedIf("version_id", func (d *schema.ResourceDiff, meta interface{}) bool { +// // Any change to "content" causes a new "version_id" to be allocated. +// return d.HasChange("content") +// }), +// ), +// } func All(funcs ...schema.CustomizeDiffFunc) schema.CustomizeDiffFunc { return func(ctx context.Context, d *schema.ResourceDiff, meta interface{}) error { var err error diff --git a/helper/resource/testcase_validate.go b/helper/resource/testcase_validate.go index 39e5da46c9c..4a4911615cb 100644 --- a/helper/resource/testcase_validate.go +++ b/helper/resource/testcase_validate.go @@ -36,10 +36,9 @@ func (c TestCase) hasProviders(_ context.Context) bool { // validate ensures the TestCase is valid based on the following criteria: // -// - No overlapping ExternalProviders and Providers entries -// - No overlapping ExternalProviders and ProviderFactories entries -// - TestStep validations performed by the (TestStep).validate() method. -// +// - No overlapping ExternalProviders and Providers entries +// - No overlapping ExternalProviders and ProviderFactories entries +// - TestStep validations performed by the (TestStep).validate() method. func (c TestCase) validate(ctx context.Context) error { logging.HelperResourceTrace(ctx, "Validating TestCase") diff --git a/helper/resource/testing.go b/helper/resource/testing.go index 8cb4dbaa664..53c3746d84d 100644 --- a/helper/resource/testing.go +++ b/helper/resource/testing.go @@ -100,10 +100,10 @@ func AddTestSweepers(name string, s *Sweeper) { // // Sweeper flags added to the "go test" command: // -// -sweep: Comma-separated list of locations/regions to run available sweepers. -// -sweep-allow-failues: Enable to allow other sweepers to run after failures. -// -sweep-run: Comma-separated list of resource type sweepers to run. Defaults -// to all sweepers. +// -sweep: Comma-separated list of locations/regions to run available sweepers. +// -sweep-allow-failues: Enable to allow other sweepers to run after failures. +// -sweep-run: Comma-separated list of resource type sweepers to run. Defaults +// to all sweepers. // // Refer to the Env prefixed constants for environment variables that further // control testing functionality. @@ -665,16 +665,16 @@ func ParallelTest(t testing.T, c TestCase) { // This function will automatically find or install Terraform CLI into a // temporary directory, based on the following behavior: // -// - If the TF_ACC_TERRAFORM_PATH environment variable is set, that -// Terraform CLI binary is used if found and executable. If not found or -// executable, an error will be returned unless the -// TF_ACC_TERRAFORM_VERSION environment variable is also set. -// - If the TF_ACC_TERRAFORM_VERSION environment variable is set, install -// and use that Terraform CLI version. -// - If both the TF_ACC_TERRAFORM_PATH and TF_ACC_TERRAFORM_VERSION -// environment variables are unset, perform a lookup for the Terraform -// CLI binary based on the operating system PATH. If not found, the -// latest available Terraform CLI binary is installed. +// - If the TF_ACC_TERRAFORM_PATH environment variable is set, that +// Terraform CLI binary is used if found and executable. If not found or +// executable, an error will be returned unless the +// TF_ACC_TERRAFORM_VERSION environment variable is also set. +// - If the TF_ACC_TERRAFORM_VERSION environment variable is set, install +// and use that Terraform CLI version. +// - If both the TF_ACC_TERRAFORM_PATH and TF_ACC_TERRAFORM_VERSION +// environment variables are unset, perform a lookup for the Terraform +// CLI binary based on the operating system PATH. If not found, the +// latest available Terraform CLI binary is installed. // // Refer to the Env prefixed constants for additional details about these // environment variables, and others, that control testing functionality. @@ -821,35 +821,35 @@ func ComposeAggregateTestCheckFunc(fs ...TestCheckFunc) TestCheckFunc { // Use this as a last resort when a more specific TestCheckFunc cannot be // implemented, such as: // -// - TestCheckResourceAttr: Equality checking of non-TypeSet state value. -// - TestCheckResourceAttrPair: Equality checking of non-TypeSet state -// value, based on another state value. -// - TestCheckTypeSet*: Equality checking of TypeSet state values. -// - TestMatchResourceAttr: Regular expression checking of non-TypeSet -// state value. -// - TestMatchTypeSet*: Regular expression checking on TypeSet state values. +// - TestCheckResourceAttr: Equality checking of non-TypeSet state value. +// - TestCheckResourceAttrPair: Equality checking of non-TypeSet state +// value, based on another state value. +// - TestCheckTypeSet*: Equality checking of TypeSet state values. +// - TestMatchResourceAttr: Regular expression checking of non-TypeSet +// state value. +// - TestMatchTypeSet*: Regular expression checking on TypeSet state values. // // For managed resources, the name parameter is combination of the resource // type, a period (.), and the name label. The name for the below example // configuration would be "myprovider_thing.example". // -// resource "myprovider_thing" "example" { ... } +// resource "myprovider_thing" "example" { ... } // // For data sources, the name parameter is a combination of the keyword "data", // a period (.), the data source type, a period (.), and the name label. The // name for the below example configuration would be // "data.myprovider_thing.example". // -// data "myprovider_thing" "example" { ... } +// data "myprovider_thing" "example" { ... } // // The key parameter is an attribute path in Terraform CLI 0.11 and earlier // "flatmap" syntax. Keys start with the attribute name of a top-level // attribute. Use the following special key syntax to inspect underlying // values of a list or map attribute: // -// - .{NUMBER}: List value at index, e.g. .0 to inspect the first element -// - .{KEY}: Map value at key, e.g. .example to inspect the example key -// value +// - .{NUMBER}: List value at index, e.g. .0 to inspect the first element +// - .{KEY}: Map value at key, e.g. .example to inspect the example key +// value // // While it is possible to check nested attributes under list and map // attributes using the special key syntax, checking a list, map, or set @@ -918,34 +918,34 @@ func testCheckResourceAttrSet(is *terraform.InstanceState, name string, key stri // type, a period (.), and the name label. The name for the below example // configuration would be "myprovider_thing.example". // -// resource "myprovider_thing" "example" { ... } +// resource "myprovider_thing" "example" { ... } // // For data sources, the name parameter is a combination of the keyword "data", // a period (.), the data source type, a period (.), and the name label. The // name for the below example configuration would be // "data.myprovider_thing.example". // -// data "myprovider_thing" "example" { ... } +// data "myprovider_thing" "example" { ... } // // The key parameter is an attribute path in Terraform CLI 0.11 and earlier // "flatmap" syntax. Keys start with the attribute name of a top-level // attribute. Use the following special key syntax to inspect list, map, and // set attributes: // -// - .{NUMBER}: List value at index, e.g. .0 to inspect the first element. -// Use the TestCheckTypeSet* and TestMatchTypeSet* functions instead -// for sets. -// - .{KEY}: Map value at key, e.g. .example to inspect the example key -// value. -// - .#: Number of elements in list or set. -// - .%: Number of elements in map. +// - .{NUMBER}: List value at index, e.g. .0 to inspect the first element. +// Use the TestCheckTypeSet* and TestMatchTypeSet* functions instead +// for sets. +// - .{KEY}: Map value at key, e.g. .example to inspect the example key +// value. +// - .#: Number of elements in list or set. +// - .%: Number of elements in map. // // The value parameter is the stringified data to check at the given key. Use // the following attribute type rules to set the value: // -// - Boolean: "false" or "true". -// - Float/Integer: Stringified number, such as "1.2" or "123". -// - String: No conversion necessary. +// - Boolean: "false" or "true". +// - Float/Integer: Stringified number, such as "1.2" or "123". +// - String: No conversion necessary. func TestCheckResourceAttr(name, key, value string) TestCheckFunc { return checkIfIndexesIntoTypeSet(key, func(s *terraform.State) error { is, err := primaryInstanceState(s, name) @@ -1032,27 +1032,27 @@ type CheckResourceAttrWithFunc func(value string) error // type, a period (.), and the name label. The name for the below example // configuration would be "myprovider_thing.example". // -// resource "myprovider_thing" "example" { ... } +// resource "myprovider_thing" "example" { ... } // // For data sources, the name parameter is a combination of the keyword "data", // a period (.), the data source type, a period (.), and the name label. The // name for the below example configuration would be // "data.myprovider_thing.example". // -// data "myprovider_thing" "example" { ... } +// data "myprovider_thing" "example" { ... } // // The key parameter is an attribute path in Terraform CLI 0.11 and earlier // "flatmap" syntax. Keys start with the attribute name of a top-level // attribute. Use the following special key syntax to inspect list, map, and // set attributes: // -// - .{NUMBER}: List value at index, e.g. .0 to inspect the first element. -// Use the TestCheckTypeSet* and TestMatchTypeSet* functions instead -// for sets. -// - .{KEY}: Map value at key, e.g. .example to inspect the example key -// value. -// - .#: Number of elements in list or set. -// - .%: Number of elements in map. +// - .{NUMBER}: List value at index, e.g. .0 to inspect the first element. +// Use the TestCheckTypeSet* and TestMatchTypeSet* functions instead +// for sets. +// - .{KEY}: Map value at key, e.g. .example to inspect the example key +// value. +// - .#: Number of elements in list or set. +// - .%: Number of elements in map. // // The checkValueFunc parameter is a CheckResourceAttrWithFunc, // and it's provided with the attribute value to apply a custom checking logic, @@ -1088,23 +1088,23 @@ func TestCheckResourceAttrWith(name, key string, checkValueFunc CheckResourceAtt // type, a period (.), and the name label. The name for the below example // configuration would be "myprovider_thing.example". // -// resource "myprovider_thing" "example" { ... } +// resource "myprovider_thing" "example" { ... } // // For data sources, the name parameter is a combination of the keyword "data", // a period (.), the data source type, a period (.), and the name label. The // name for the below example configuration would be // "data.myprovider_thing.example". // -// data "myprovider_thing" "example" { ... } +// data "myprovider_thing" "example" { ... } // // The key parameter is an attribute path in Terraform CLI 0.11 and earlier // "flatmap" syntax. Keys start with the attribute name of a top-level // attribute. Use the following special key syntax to inspect underlying // values of a list or map attribute: // -// - .{NUMBER}: List value at index, e.g. .0 to inspect the first element. -// - .{KEY}: Map value at key, e.g. .example to inspect the example key -// value. +// - .{NUMBER}: List value at index, e.g. .0 to inspect the first element. +// - .{KEY}: Map value at key, e.g. .example to inspect the example key +// value. // // While it is possible to check nested attributes under list and map // attributes using the special key syntax, checking a list, map, or set @@ -1180,27 +1180,27 @@ func testCheckNoResourceAttr(is *terraform.InstanceState, name string, key strin // type, a period (.), and the name label. The name for the below example // configuration would be "myprovider_thing.example". // -// resource "myprovider_thing" "example" { ... } +// resource "myprovider_thing" "example" { ... } // // For data sources, the name parameter is a combination of the keyword "data", // a period (.), the data source type, a period (.), and the name label. The // name for the below example configuration would be // "data.myprovider_thing.example". // -// data "myprovider_thing" "example" { ... } +// data "myprovider_thing" "example" { ... } // // The key parameter is an attribute path in Terraform CLI 0.11 and earlier // "flatmap" syntax. Keys start with the attribute name of a top-level // attribute. Use the following special key syntax to inspect list, map, and // set attributes: // -// - .{NUMBER}: List value at index, e.g. .0 to inspect the first element. -// Use the TestCheckTypeSet* and TestMatchTypeSet* functions instead -// for sets. -// - .{KEY}: Map value at key, e.g. .example to inspect the example key -// value. -// - .#: Number of elements in list or set. -// - .%: Number of elements in map. +// - .{NUMBER}: List value at index, e.g. .0 to inspect the first element. +// Use the TestCheckTypeSet* and TestMatchTypeSet* functions instead +// for sets. +// - .{KEY}: Map value at key, e.g. .example to inspect the example key +// value. +// - .#: Number of elements in list or set. +// - .%: Number of elements in map. // // The value parameter is a compiled regular expression. A typical pattern is // using the regexp.MustCompile() function, which will automatically ensure the @@ -1273,14 +1273,14 @@ func TestCheckModuleResourceAttrPtr(mp []string, name string, key string, value // type, a period (.), and the name label. The name for the below example // configuration would be "myprovider_thing.example". // -// resource "myprovider_thing" "example" { ... } +// resource "myprovider_thing" "example" { ... } // // For data sources, the name parameter is a combination of the keyword "data", // a period (.), the data source type, a period (.), and the name label. The // name for the below example configuration would be // "data.myprovider_thing.example". // -// data "myprovider_thing" "example" { ... } +// data "myprovider_thing" "example" { ... } // // The first and second names may use any combination of managed resources // and/or data sources. @@ -1290,13 +1290,13 @@ func TestCheckModuleResourceAttrPtr(mp []string, name string, key string, value // attribute. Use the following special key syntax to inspect list, map, and // set attributes: // -// - .{NUMBER}: List value at index, e.g. .0 to inspect the first element. -// Use the TestCheckTypeSet* and TestMatchTypeSet* functions instead -// for sets. -// - .{KEY}: Map value at key, e.g. .example to inspect the example key -// value. -// - .#: Number of elements in list or set. -// - .%: Number of elements in map. +// - .{NUMBER}: List value at index, e.g. .0 to inspect the first element. +// Use the TestCheckTypeSet* and TestMatchTypeSet* functions instead +// for sets. +// - .{KEY}: Map value at key, e.g. .example to inspect the example key +// value. +// - .#: Number of elements in list or set. +// - .%: Number of elements in map. func TestCheckResourceAttrPair(nameFirst, keyFirst, nameSecond, keySecond string) TestCheckFunc { return checkIfIndexesIntoTypeSetPair(keyFirst, keySecond, func(s *terraform.State) error { isFirst, err := primaryInstanceState(s, nameFirst) diff --git a/helper/resource/testing_sets.go b/helper/resource/testing_sets.go index 9b1d57c6665..3cdb4b9ecc4 100644 --- a/helper/resource/testing_sets.go +++ b/helper/resource/testing_sets.go @@ -25,14 +25,14 @@ const ( // type, a period (.), and the name label. The name for the below example // configuration would be "myprovider_thing.example". // -// resource "myprovider_thing" "example" { ... } +// resource "myprovider_thing" "example" { ... } // // For data sources, the name parameter is a combination of the keyword "data", // a period (.), the data source type, a period (.), and the name label. The // name for the below example configuration would be // "data.myprovider_thing.example". // -// data "myprovider_thing" "example" { ... } +// data "myprovider_thing" "example" { ... } // // The key parameter is an attribute path in Terraform CLI 0.11 and earlier // "flatmap" syntax. Keys start with the attribute name of a top-level @@ -46,10 +46,10 @@ const ( // You may check for unset nested attributes, however this will also match keys // set to an empty string. Use a map with at least 1 non-empty value. // -// map[string]string{ -// "key1": "value", -// "key2": "", -// } +// map[string]string{ +// "key1": "value", +// "key2": "", +// } // // If the values map is not granular enough, it is possible to match an element // you were not intending to in the set. Provide the most complete mapping of @@ -97,14 +97,14 @@ func TestCheckTypeSetElemNestedAttrs(name, attr string, values map[string]string // type, a period (.), and the name label. The name for the below example // configuration would be "myprovider_thing.example". // -// resource "myprovider_thing" "example" { ... } +// resource "myprovider_thing" "example" { ... } // // For data sources, the name parameter is a combination of the keyword "data", // a period (.), the data source type, a period (.), and the name label. The // name for the below example configuration would be // "data.myprovider_thing.example". // -// data "myprovider_thing" "example" { ... } +// data "myprovider_thing" "example" { ... } // // The key parameter is an attribute path in Terraform CLI 0.11 and earlier // "flatmap" syntax. Keys start with the attribute name of a top-level @@ -118,10 +118,10 @@ func TestCheckTypeSetElemNestedAttrs(name, attr string, values map[string]string // You may check for unset nested attributes, however this will also match keys // set to an empty string. Use a map with at least 1 non-empty value. // -// map[string]*regexp.Regexp{ -// "key1": regexp.MustCompile(`^value`), -// "key2": regexp.MustCompile(`^$`), -// } +// map[string]*regexp.Regexp{ +// "key1": regexp.MustCompile(`^value`), +// "key2": regexp.MustCompile(`^$`), +// } // // If the values map is not granular enough, it is possible to match an element // you were not intending to in the set. Provide the most complete mapping of @@ -176,14 +176,14 @@ func TestMatchTypeSetElemNestedAttrs(name, attr string, values map[string]*regex // type, a period (.), and the name label. The name for the below example // configuration would be "myprovider_thing.example". // -// resource "myprovider_thing" "example" { ... } +// resource "myprovider_thing" "example" { ... } // // For data sources, the name parameter is a combination of the keyword "data", // a period (.), the data source type, a period (.), and the name label. The // name for the below example configuration would be // "data.myprovider_thing.example". // -// data "myprovider_thing" "example" { ... } +// data "myprovider_thing" "example" { ... } // // The key parameter is an attribute path in Terraform CLI 0.11 and earlier // "flatmap" syntax. Keys start with the attribute name of a top-level @@ -194,9 +194,9 @@ func TestMatchTypeSetElemNestedAttrs(name, attr string, values map[string]*regex // The value parameter is the stringified data to check at the given key. Use // the following attribute type rules to set the value: // -// - Boolean: "false" or "true". -// - Float/Integer: Stringified number, such as "1.2" or "123". -// - String: No conversion necessary. +// - Boolean: "false" or "true". +// - Float/Integer: Stringified number, such as "1.2" or "123". +// - String: No conversion necessary. func TestCheckTypeSetElemAttr(name, attr, value string) TestCheckFunc { return func(s *terraform.State) error { is, err := primaryInstanceState(s, name) @@ -222,14 +222,14 @@ func TestCheckTypeSetElemAttr(name, attr, value string) TestCheckFunc { // type, a period (.), and the name label. The name for the below example // configuration would be "myprovider_thing.example". // -// resource "myprovider_thing" "example" { ... } +// resource "myprovider_thing" "example" { ... } // // For data sources, the name parameter is a combination of the keyword "data", // a period (.), the data source type, a period (.), and the name label. The // name for the below example configuration would be // "data.myprovider_thing.example". // -// data "myprovider_thing" "example" { ... } +// data "myprovider_thing" "example" { ... } // // The first and second names may use any combination of managed resources // and/or data sources. diff --git a/helper/resource/teststep_validate.go b/helper/resource/teststep_validate.go index e9239328c69..95b36e7b97c 100644 --- a/helper/resource/teststep_validate.go +++ b/helper/resource/teststep_validate.go @@ -43,17 +43,16 @@ func (s TestStep) hasProviders(_ context.Context) bool { // validate ensures the TestStep is valid based on the following criteria: // -// - Config or ImportState is set. -// - Providers are not specified (ExternalProviders, -// ProtoV5ProviderFactories, ProtoV6ProviderFactories, ProviderFactories) -// if specified at the TestCase level. -// - Providers are specified (ExternalProviders, ProtoV5ProviderFactories, -// ProtoV6ProviderFactories, ProviderFactories) if not specified at the -// TestCase level. -// - No overlapping ExternalProviders and ProviderFactories entries -// - ResourceName is not empty when ImportState is true, ImportStateIdFunc -// is not set, and ImportStateId is not set. -// +// - Config or ImportState is set. +// - Providers are not specified (ExternalProviders, +// ProtoV5ProviderFactories, ProtoV6ProviderFactories, ProviderFactories) +// if specified at the TestCase level. +// - Providers are specified (ExternalProviders, ProtoV5ProviderFactories, +// ProtoV6ProviderFactories, ProviderFactories) if not specified at the +// TestCase level. +// - No overlapping ExternalProviders and ProviderFactories entries +// - ResourceName is not empty when ImportState is true, ImportStateIdFunc +// is not set, and ImportStateId is not set. func (s TestStep) validate(ctx context.Context, req testStepValidateRequest) error { ctx = logging.TestStepNumberContext(ctx, req.StepNumber) diff --git a/helper/schema/resource.go b/helper/schema/resource.go index 5b40bec8964..28a7600b077 100644 --- a/helper/schema/resource.go +++ b/helper/schema/resource.go @@ -33,16 +33,16 @@ var ReservedResourceFields = []string{ // Resource is an abstraction for multiple Terraform concepts: // -// - Managed Resource: An infrastructure component with a schema, lifecycle -// operations such as create, read, update, and delete -// (CRUD), and optional implementation details such as -// import support, upgrade state support, and difference -// customization. -// - Data Resource: Also known as a data source. An infrastructure component -// with a schema and only the read lifecycle operation. -// - Block: When implemented within a Schema type Elem field, a configuration -// block that contains nested schema information such as attributes -// and blocks. +// - Managed Resource: An infrastructure component with a schema, lifecycle +// operations such as create, read, update, and delete +// (CRUD), and optional implementation details such as +// import support, upgrade state support, and difference +// customization. +// - Data Resource: Also known as a data source. An infrastructure component +// with a schema and only the read lifecycle operation. +// - Block: When implemented within a Schema type Elem field, a configuration +// block that contains nested schema information such as attributes +// and blocks. // // To fully implement managed resources, the Provider type ResourcesMap field // should include a reference to an implementation of this type. To fully @@ -666,13 +666,13 @@ type StateUpgrader struct { // or block names mapped to values that can be type asserted similar to // fetching values using the ResourceData Get* methods: // -// - TypeBool: bool -// - TypeFloat: float -// - TypeInt: int -// - TypeList: []interface{} -// - TypeMap: map[string]interface{} -// - TypeSet: *Set -// - TypeString: string +// - TypeBool: bool +// - TypeFloat: float +// - TypeInt: int +// - TypeList: []interface{} +// - TypeMap: map[string]interface{} +// - TypeSet: *Set +// - TypeString: string // // In certain scenarios, the map may be nil, so checking for that condition // upfront is recommended to prevent potential panics. diff --git a/helper/schema/resource_timeout.go b/helper/schema/resource_timeout.go index 2594677f5e5..93f6fc243cf 100644 --- a/helper/schema/resource_timeout.go +++ b/helper/schema/resource_timeout.go @@ -160,7 +160,6 @@ func unsupportedTimeoutKeyError(key string) error { // // StateEncode encodes the timeout into the ResourceData's InstanceState for // saving to state -// func (t *ResourceTimeout) DiffEncode(id *terraform.InstanceDiff) error { return t.metaEncode(id) } diff --git a/internal/tfdiags/diagnostics.go b/internal/tfdiags/diagnostics.go index 925c14fa7b6..5d313e79dcd 100644 --- a/internal/tfdiags/diagnostics.go +++ b/internal/tfdiags/diagnostics.go @@ -52,7 +52,7 @@ func (diags Diagnostics) ForRPC() Diagnostics { // that aren't accompanied by at least one error) since such APIs have no // mechanism through which to report these. // -// return result, diags.Error() +// return result, diags.Error() func (diags Diagnostics) Err() error { if !diags.HasErrors() { return nil diff --git a/terraform/state.go b/terraform/state.go index 170e20cd0ad..f0d97bb27cd 100644 --- a/terraform/state.go +++ b/terraform/state.go @@ -1145,7 +1145,6 @@ func parseResourceStateKey(k string) (*ResourceStateKey, error) { // // Extra is just extra data that a provider can return that we store // for later, but is not exposed in any way to the user. -// type ResourceState struct { // This is filled in and managed by Terraform, and is the resource // type itself such as "mycloud_instance". If a resource provider sets