ListIterator now implements next and current command (e.g it.next)
This commit is contained in:
parent
06373f5126
commit
2a2840bdf2
@ -90,16 +90,20 @@ func (it *ListIterator) TypeName() string {
|
||||
}
|
||||
|
||||
func (it *ListIterator) HasOperation(name string) bool {
|
||||
yes := name == resetName || name == indexName || name == countName
|
||||
yes := name == nextName || name == resetName || name == indexName || name == countName || name == currentName
|
||||
return yes
|
||||
}
|
||||
|
||||
func (it *ListIterator) CallOperation(name string, args []any) (v any, err error) {
|
||||
switch name {
|
||||
case nextName:
|
||||
v, err = it.Next()
|
||||
case resetName:
|
||||
v, err = it.Reset()
|
||||
case indexName:
|
||||
v = int64(it.Index())
|
||||
case currentName:
|
||||
v, err = it.Current()
|
||||
case countName:
|
||||
v = it.count
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user