Skip to content

Commit

Permalink
Move tftypes package to root of module. (#70)
Browse files Browse the repository at this point in the history
Rather than making tftypes a namespaced package and having one per
protocol version, we're going to use the same implementation across
protocol versions. To reflect this, move tftypes to the root of the
module, not namespaced by a protocol version, and rewrite the imports
for it.
  • Loading branch information
paddycarver authored Mar 31, 2021
1 parent bbc1a4d commit 014db87
Show file tree
Hide file tree
Showing 36 changed files with 17 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .changelog/70.txt
Original file line number Diff line number Diff line change
@@ -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.
```
2 changes: 1 addition & 1 deletion tfprotov5/diagnostic.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tfprotov5/dynamic_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion tfprotov5/dynamic_value_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tfprotov5/dynamic_value_json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tfprotov5/dynamic_value_msgpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion tfprotov5/dynamic_value_msgpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tfprotov5/internal/fromproto/attribute_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion tfprotov5/internal/fromproto/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tfprotov5/internal/toproto/attribute_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion tfprotov5/internal/toproto/dynamic_value.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tfprotov5/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tfprotov5/schema.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tfprotov5/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 014db87

Please sign in to comment.