Skip to content

Commit f7549d1

Browse files
authored
Add GoString to v2InstanceDiff2 (#2055)
Implement String() and GoString() on v2InstanceDiff2. This should not be user-visible but helps working with and debugging tests in the codebase.
1 parent c6611a4 commit f7549d1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pkg/tfshim/sdk-v2/provider2.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,23 @@ type v2InstanceDiff2 struct {
109109
plannedState cty.Value
110110
}
111111

112+
func (d *v2InstanceDiff2) String() string {
113+
return d.GoString()
114+
}
115+
116+
func (d *v2InstanceDiff2) GoString() string {
117+
if d == nil {
118+
return "nil"
119+
}
120+
return fmt.Sprintf(`&v2InstanceDiff2{
121+
v2InstanceDiff: v2InstanceDiff{
122+
tf: %#v,
123+
},
124+
config: %#v,
125+
plannedState: %#v,
126+
}`, d.v2InstanceDiff.tf, d.config, d.plannedState)
127+
}
128+
112129
var _ shim.InstanceDiff = (*v2InstanceDiff2)(nil)
113130

114131
func (d *v2InstanceDiff2) ProposedState(

0 commit comments

Comments
 (0)