Skip to content

Commit ecfb99d

Browse files
lint
1 parent a8ad0b6 commit ecfb99d

File tree

2 files changed

+1
-34
lines changed

2 files changed

+1
-34
lines changed

pkg/valueshim/tftype_json.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ func jsonMarshalBool(v tftypes.Value, typ tftypes.Type, p *tftypes.AttributePath
9191

9292
func jsonMarshalDynamicPseudoType(v tftypes.Value, _ tftypes.Type, p *tftypes.AttributePath) (interface{}, error) {
9393
valType := v.Type()
94+
//nolint:staticcheck // the method isn't really deprecated but rather internal
9495
typeJSON, err := valType.MarshalJSON()
9596
if err != nil {
9697
return nil, p.NewError(err)

pkg/valueshim/tftype_json_test.go

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -540,37 +540,3 @@ func TestValueToJSON_EdgeCases(t *testing.T) {
540540
})
541541
}
542542
}
543-
544-
func TestValueToJSON_RoundTrip(t *testing.T) {
545-
t.Parallel()
546-
547-
// Test that we can round-trip simple values through JSON
548-
testCases := []struct {
549-
name string
550-
typ tftypes.Type
551-
value tftypes.Value
552-
}{
553-
{"string", tftypes.String, tftypes.NewValue(tftypes.String, "test")},
554-
{"number", tftypes.Number, tftypes.NewValue(tftypes.Number, 42)},
555-
{"bool", tftypes.Bool, tftypes.NewValue(tftypes.Bool, true)},
556-
{"null string", tftypes.String, tftypes.NewValue(tftypes.String, nil)},
557-
}
558-
559-
for _, tc := range testCases {
560-
t.Run(tc.name, func(t *testing.T) {
561-
t.Parallel()
562-
563-
// Convert to JSON
564-
jsonBytes, err := tftypeValueToJSON(tc.typ, tc.value)
565-
require.NoError(t, err)
566-
567-
// Convert back from JSON
568-
reconstructed, err := tftypes.ValueFromJSON(jsonBytes, tc.typ)
569-
require.NoError(t, err)
570-
571-
// Should be equal
572-
assert.True(t, tc.value.Equal(reconstructed),
573-
"Original: %s, Reconstructed: %s", tc.value.String(), reconstructed.String())
574-
})
575-
}
576-
}

0 commit comments

Comments
 (0)