dict-iterator.go: NewDictIteratorA() and description comment

This commit is contained in:
2026-08-02 16:49:59 +02:00
parent 7e4baf9b6e
commit 72c2a6b52a
+7
View File
@@ -70,6 +70,13 @@ func (it *DictIterator) makeKeys(m map[any]any, sort sortType) {
} }
} }
// NewDictIterator creates a new DictIterator for the given dict.DictType and optional arguments.
// The first argument can be a string specifying the sort type ("asc", "desc", "none", or "default").
// The second argument can be a string specifying the iteration mode ("keys", "values", "items", or "default").
func NewDictIteratorA(dict *dict.DictType, args ...any) (it *DictIterator, err error) {
return NewDictIterator(dict, args)
}
func NewDictIterator(dict *dict.DictType, args []any) (it *DictIterator, err error) { func NewDictIterator(dict *dict.DictType, args []any) (it *DictIterator, err error) {
var sortType = sortTypeNone var sortType = sortTypeNone
var s string var s string