diff --git a/.changelog/70.txt b/.changelog/70.txt new file mode 100644 index 000000000..30e0d4a89 --- /dev/null +++ b/.changelog/70.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +The `tftypes` package has been moved to the root of the module and is no longer under the `tfprotov5` package. Providers can automatically rewrite their import paths using a command like `sed -i 's/"github.com\/hashicorp\/terraform-plugin-go\/tfprotov5\/tftypes"/"github.com\/hashicorp\/terraform-plugin-go\/tftypes"/g' **/*.go` on Unix-like systems. +``` diff --git a/tfprotov5/diagnostic.go b/tfprotov5/diagnostic.go index 04a39deb3..de0906e33 100644 --- a/tfprotov5/diagnostic.go +++ b/tfprotov5/diagnostic.go @@ -1,6 +1,6 @@ package tfprotov5 -import "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" +import "github.com/hashicorp/terraform-plugin-go/tftypes" const ( // DiagnosticSeverityInvalid is used to indicate an invalid diff --git a/tfprotov5/dynamic_value.go b/tfprotov5/dynamic_value.go index 951532cc5..de7829e18 100644 --- a/tfprotov5/dynamic_value.go +++ b/tfprotov5/dynamic_value.go @@ -4,7 +4,7 @@ import ( "bytes" "errors" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" "github.com/vmihailenco/msgpack" ) diff --git a/tfprotov5/dynamic_value_json.go b/tfprotov5/dynamic_value_json.go index 98fc44fa3..7578207b8 100644 --- a/tfprotov5/dynamic_value_json.go +++ b/tfprotov5/dynamic_value_json.go @@ -6,7 +6,7 @@ import ( "math/big" "strings" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) func jsonByteDecoder(buf []byte) *json.Decoder { diff --git a/tfprotov5/dynamic_value_json_test.go b/tfprotov5/dynamic_value_json_test.go index cf41e06fc..828886659 100644 --- a/tfprotov5/dynamic_value_json_test.go +++ b/tfprotov5/dynamic_value_json_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) func TestDynamicValueJSON(t *testing.T) { diff --git a/tfprotov5/dynamic_value_msgpack.go b/tfprotov5/dynamic_value_msgpack.go index 6f8e7f597..95762e118 100644 --- a/tfprotov5/dynamic_value_msgpack.go +++ b/tfprotov5/dynamic_value_msgpack.go @@ -3,7 +3,7 @@ package tfprotov5 import ( "math/big" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" "github.com/vmihailenco/msgpack" msgpackCodes "github.com/vmihailenco/msgpack/codes" ) diff --git a/tfprotov5/dynamic_value_msgpack_test.go b/tfprotov5/dynamic_value_msgpack_test.go index 3935b958d..90f6587e3 100644 --- a/tfprotov5/dynamic_value_msgpack_test.go +++ b/tfprotov5/dynamic_value_msgpack_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) func TestDynamicValueMsgPack(t *testing.T) { diff --git a/tfprotov5/internal/fromproto/attribute_path.go b/tfprotov5/internal/fromproto/attribute_path.go index 184aa4894..421bfbec5 100644 --- a/tfprotov5/internal/fromproto/attribute_path.go +++ b/tfprotov5/internal/fromproto/attribute_path.go @@ -4,7 +4,7 @@ import ( "errors" "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) var ErrUnknownAttributePathStepType = errors.New("unknown type of AttributePath_Step") diff --git a/tfprotov5/internal/fromproto/schema.go b/tfprotov5/internal/fromproto/schema.go index beff9ca31..90f2e0322 100644 --- a/tfprotov5/internal/fromproto/schema.go +++ b/tfprotov5/internal/fromproto/schema.go @@ -5,7 +5,7 @@ import ( "github.com/hashicorp/terraform-plugin-go/tfprotov5" "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) func Schema(in *tfplugin5.Schema) (*tfprotov5.Schema, error) { diff --git a/tfprotov5/internal/toproto/attribute_path.go b/tfprotov5/internal/toproto/attribute_path.go index 11c587fde..58397ebdc 100644 --- a/tfprotov5/internal/toproto/attribute_path.go +++ b/tfprotov5/internal/toproto/attribute_path.go @@ -4,7 +4,7 @@ import ( "errors" "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) var ErrUnknownAttributePathStepType = errors.New("unknown type of AttributePath_Step") diff --git a/tfprotov5/internal/toproto/dynamic_value.go b/tfprotov5/internal/toproto/dynamic_value.go index 0c0af8a8a..325e929a0 100644 --- a/tfprotov5/internal/toproto/dynamic_value.go +++ b/tfprotov5/internal/toproto/dynamic_value.go @@ -5,7 +5,7 @@ import ( "github.com/hashicorp/terraform-plugin-go/tfprotov5" "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) func DynamicValue(in *tfprotov5.DynamicValue) *tfplugin5.DynamicValue { diff --git a/tfprotov5/resource.go b/tfprotov5/resource.go index ea16343f7..c3fdd6ce4 100644 --- a/tfprotov5/resource.go +++ b/tfprotov5/resource.go @@ -3,7 +3,7 @@ package tfprotov5 import ( "context" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) // ResourceServer is an interface containing the methods a resource diff --git a/tfprotov5/schema.go b/tfprotov5/schema.go index a2c7426cc..ffcb96577 100644 --- a/tfprotov5/schema.go +++ b/tfprotov5/schema.go @@ -1,6 +1,6 @@ package tfprotov5 -import "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" +import "github.com/hashicorp/terraform-plugin-go/tftypes" const ( // SchemaNestedBlockNestingModeInvalid indicates that the nesting mode diff --git a/tfprotov5/state.go b/tfprotov5/state.go index d66ed5c5d..04dab0116 100644 --- a/tfprotov5/state.go +++ b/tfprotov5/state.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) // ErrUnknownRawStateType is returned when a RawState has no Flatmap or JSON diff --git a/tfprotov5/tftypes/attribute_path.go b/tftypes/attribute_path.go similarity index 100% rename from tfprotov5/tftypes/attribute_path.go rename to tftypes/attribute_path.go diff --git a/tfprotov5/tftypes/attribute_path_error.go b/tftypes/attribute_path_error.go similarity index 100% rename from tfprotov5/tftypes/attribute_path_error.go rename to tftypes/attribute_path_error.go diff --git a/tfprotov5/tftypes/attribute_path_test.go b/tftypes/attribute_path_test.go similarity index 100% rename from tfprotov5/tftypes/attribute_path_test.go rename to tftypes/attribute_path_test.go diff --git a/tfprotov5/tftypes/diff.go b/tftypes/diff.go similarity index 100% rename from tfprotov5/tftypes/diff.go rename to tftypes/diff.go diff --git a/tfprotov5/tftypes/diff_test.go b/tftypes/diff_test.go similarity index 100% rename from tfprotov5/tftypes/diff_test.go rename to tftypes/diff_test.go diff --git a/tfprotov5/tftypes/doc.go b/tftypes/doc.go similarity index 100% rename from tfprotov5/tftypes/doc.go rename to tftypes/doc.go diff --git a/tfprotov5/tftypes/list.go b/tftypes/list.go similarity index 100% rename from tfprotov5/tftypes/list.go rename to tftypes/list.go diff --git a/tfprotov5/tftypes/map.go b/tftypes/map.go similarity index 100% rename from tfprotov5/tftypes/map.go rename to tftypes/map.go diff --git a/tfprotov5/tftypes/object.go b/tftypes/object.go similarity index 100% rename from tfprotov5/tftypes/object.go rename to tftypes/object.go diff --git a/tfprotov5/tftypes/primitive.go b/tftypes/primitive.go similarity index 100% rename from tfprotov5/tftypes/primitive.go rename to tftypes/primitive.go diff --git a/tfprotov5/tftypes/set.go b/tftypes/set.go similarity index 100% rename from tfprotov5/tftypes/set.go rename to tftypes/set.go diff --git a/tfprotov5/tftypes/tuple.go b/tftypes/tuple.go similarity index 100% rename from tfprotov5/tftypes/tuple.go rename to tftypes/tuple.go diff --git a/tfprotov5/tftypes/type.go b/tftypes/type.go similarity index 100% rename from tfprotov5/tftypes/type.go rename to tftypes/type.go diff --git a/tfprotov5/tftypes/type_json_test.go b/tftypes/type_json_test.go similarity index 100% rename from tfprotov5/tftypes/type_json_test.go rename to tftypes/type_json_test.go diff --git a/tfprotov5/tftypes/unknown_value.go b/tftypes/unknown_value.go similarity index 100% rename from tfprotov5/tftypes/unknown_value.go rename to tftypes/unknown_value.go diff --git a/tfprotov5/tftypes/value.go b/tftypes/value.go similarity index 100% rename from tfprotov5/tftypes/value.go rename to tftypes/value.go diff --git a/tfprotov5/tftypes/value_example_test.go b/tftypes/value_example_test.go similarity index 98% rename from tfprotov5/tftypes/value_example_test.go rename to tftypes/value_example_test.go index 597cfd437..b530014fa 100644 --- a/tfprotov5/tftypes/value_example_test.go +++ b/tftypes/value_example_test.go @@ -3,7 +3,7 @@ package tftypes_test import ( "fmt" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) func ExampleValue_As_string() { diff --git a/tfprotov5/tftypes/value_msgpack.go b/tftypes/value_msgpack.go similarity index 100% rename from tfprotov5/tftypes/value_msgpack.go rename to tftypes/value_msgpack.go diff --git a/tfprotov5/tftypes/value_number_test.go b/tftypes/value_number_test.go similarity index 100% rename from tfprotov5/tftypes/value_number_test.go rename to tftypes/value_number_test.go diff --git a/tfprotov5/tftypes/value_test.go b/tftypes/value_test.go similarity index 100% rename from tfprotov5/tftypes/value_test.go rename to tftypes/value_test.go diff --git a/tfprotov5/tftypes/walk.go b/tftypes/walk.go similarity index 100% rename from tfprotov5/tftypes/walk.go rename to tftypes/walk.go diff --git a/tfprotov5/tftypes/walk_test.go b/tftypes/walk_test.go similarity index 100% rename from tfprotov5/tftypes/walk_test.go rename to tftypes/walk_test.go