Skip to content

Commit

Permalink
Move check into rpc/init
Browse files Browse the repository at this point in the history
* Add link to GitHub Issue
  • Loading branch information
nywilken committed Jun 15, 2023
1 parent 0c09c89 commit df99313
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 0 additions & 6 deletions rpc/cty_encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
package rpc

import (
"encoding/gob"

"github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/json"
)

// Test that cty types implement the gob.GobEncoder interface.
// Support for encoding/gob was removed in github.com/zclconf/go-cty@v1.11.0.
var _ gob.GobEncoder = cty.Value{}

// cty.Value is does not know how to encode itself through the wire so we
// transform it to bytes.
func encodeCTYValues(config []interface{}) ([]interface{}, error) {
Expand Down
11 changes: 10 additions & 1 deletion rpc/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ underpins the packer server that all plugins must implement.
*/
package rpc

import "encoding/gob"
import (
"encoding/gob"

"github.com/zclconf/go-cty/cty"
)

// Test that cty types implement the gob.GobEncoder interface.
// Support for encoding/gob was removed in github.com/zclconf/go-cty@v1.11.0.
// Refer to issue https://github.com/hashicorp/packer-plugin-sdk/issues/187
var _ gob.GobEncoder = cty.Value{}

func init() {
gob.Register(new(map[string]string))
Expand Down

0 comments on commit df99313

Please sign in to comment.