Sourced from github.com/zclconf/go-cty's releases.
v1.17.0
ctynow requires Go 1.23 or later.
cty.Value.Elementsoffers a moderniter.Seq2-based equivalent ofcty.Value.ElementIterator.
cty.DeepValuesoffers a moderniter.Seq2-based equivalent ofcty.Walk.
cty.Value.WrangleMarksDeepallows inspecting and modifying individual marks throughout a possibly-nested data structure.Having now got some experience using marks more extensively in some callers, it's become clear that it's often necessary for different subsystems to be able to collaborate using independent marks without upsetting each other's assumptions. Today that tends to be achieved using hand-written transforms either with
cty.Transformorcty.Value.UnmarkDeepWithPaths/cty.Value.MarkWithPaths, both of which can be pretty expensive even in the common case where there are no marks present at all.This new function allows inspecting and transforming marks with far less overhead, by creating new values only for parts of a structure that actually need to change and by reusing (rather than recreating) the "payloads" of the values being modified when we know that only the marks have changed.
cty.ValueMarksOfTypeandcty.ValueMarksOfTypeDeepmake it easier to use type-based rather than value-based mark schemes, where different values of a common type are used to track a specific kind of relationship with multiple external values.
cty.Value.HasMarkDeepprovides a "deep" version of the existingcty.Value.HasMark, searching throughout a possibly-nested structure for any values that have the given mark.
cty.Value.UnmarkDeepandcty.Value.UnmarkDeepWithPathsare now implemented in terms ofcty.Value.WrangleMarksDeep, so they benefit from its reduced overhead. In particular they avoid reconstructing a data structure that contains no marked values at all.
cty.Value.MarkWithPathsnow has a fast path when it's given a zero-lengthPathValueMarks, in which case it just returns the value it was given with no modifications.
Sourced from github.com/zclconf/go-cty's changelog.
1.17.0 (September 5, 2025)
ctynow requires Go 1.23 or later.
cty.Value.Elementsoffers a moderniter.Seq2-based equivalent ofcty.Value.ElementIterator.
cty.DeepValuesoffers a moderniter.Seq2-based equivalent ofcty.Walk.
cty.Value.WrangleMarksDeepallows inspecting and modifying individual marks throughout a possibly-nested data structure.Having now got some experience using marks more extensively in some callers, it's become clear that it's often necessary for different subsystems to be able to collaborate using independent marks without upsetting each other's assumptions. Today that tends to be achieved using hand-written transforms either with
cty.Transformorcty.Value.UnmarkDeepWithPaths/cty.Value.MarkWithPaths, both of which can be pretty expensive even in the common case where there are no marks present at all.This new function allows inspecting and transforming marks with far less overhead, by creating new values only for parts of a structure that actually need to change and by reusing (rather than recreating) the "payloads" of the values being modified when we know that only the marks have changed.
cty.ValueMarksOfTypeandcty.ValueMarksOfTypeDeepmake it easier to use type-based rather than value-based mark schemes, where different values of a common type are used to track a specific kind of relationship with multiple external values.
cty.Value.HasMarkDeepprovides a "deep" version of the existingcty.Value.HasMark, searching throughout a possibly-nested structure for any values that have the given mark.
cty.Value.UnmarkDeepandcty.Value.UnmarkDeepWithPathsare now implemented in terms ofcty.Value.WrangleMarksDeep, so they benefit from its reduced overhead. In particular they avoid reconstructing a data structure that contains no marked values at all.
cty.Value.MarkWithPathsnow has a fast path when it's given a zero-lengthPathValueMarks, in which case it just returns the value it was given with no modifications.1.16.4 (August 20, 2025)
cty.UnknownAsNullnow accepts marked values and preserves the given marks in its result. Previously it had no direct support for marks and so would either panic or return incorrect results when given marked values.
da4c600
CHANGELOG: Prepare for v1.17.0 releaseb13ddd4
cty: Use WrangleMarksDeep for UnmarkDeep and UnmarkDeepWithPaths4453ac2
cty: Use DeepValues instead of Walk for deep marks inspectionsf833b10
Bulk replace interface{} -> anyd4bb9d4
cty: Various new mark-inspecting helpers31572cf
cty+ctymarks: Deep mark wrangling helperd95a68c
cty: Modern iter.Seq2 equivalents of Value.ElementIterator and Walke76eeea
v1.16.4 release700a2bc
cty: UnknownAsNull accepts marked values and preserves marks3c2b6a0
Prepare for future v1.16.4 release