From 59fecf7a2d592fc2256d0788a116bac215feb42d Mon Sep 17 00:00:00 2001 From: Kazuma Watanabe Date: Mon, 7 Aug 2023 14:24:54 +0000 Subject: [PATCH] Add a note for CanIterateElements about unknown and null --- cty/value_ops.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cty/value_ops.go b/cty/value_ops.go index c4584bd9..70e5b72b 100644 --- a/cty/value_ops.go +++ b/cty/value_ops.go @@ -1198,8 +1198,9 @@ func (val Value) ElementIterator() ElementIterator { return elementIterator(val) } -// CanIterateElements returns true if the receiver can support the +// CanIterateElements returns true if the receiver type can support the // ElementIterator method (and by extension, ForEachElement) without panic. +// Note this method will panic if the receiver is Unknown or null. func (val Value) CanIterateElements() bool { return canElementIterator(val) }