Skip to content

Commit ec806f2

Browse files
committed
Do not register types with gob.
This allows this package to be linked into the same binary as terraform.
1 parent d76cf67 commit ec806f2

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

internal/tfdiags/rpc_friendly.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package tfdiags
22

3-
import (
4-
"encoding/gob"
5-
)
6-
73
type rpcFriendlyDiag struct {
84
Severity_ Severity
95
Summary_ string
@@ -53,7 +49,3 @@ func (d rpcFriendlyDiag) FromExpr() *FromExpr {
5349
// expressions themselves are not RPC-friendly.
5450
return nil
5551
}
56-
57-
func init() {
58-
gob.Register((*rpcFriendlyDiag)(nil))
59-
}

terraform/plan.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,13 @@ package terraform
22

33
import (
44
"bytes"
5-
"encoding/gob"
65
"fmt"
76
"io"
87

98
"github.com/hashicorp/terraform-plugin-sdk/internal/configs"
109
"github.com/zclconf/go-cty/cty"
1110
)
1211

13-
func init() {
14-
gob.Register(make([]interface{}, 0))
15-
gob.Register(make([]map[string]interface{}, 0))
16-
gob.Register(make(map[string]interface{}))
17-
gob.Register(make(map[string]string))
18-
}
19-
2012
// Plan represents a single Terraform execution plan, which contains
2113
// all the information necessary to make an infrastructure change.
2214
//

0 commit comments

Comments
 (0)