This commit is contained in:
tursom 2021-06-28 10:39:20 +08:00
parent c7576d9b3b
commit 0fcabc8b65
4 changed files with 6 additions and 3 deletions

BIN
GoCollections Normal file

Binary file not shown.

View File

@ -6,7 +6,7 @@ type Queue interface {
// Iterator MutableIterable
Iterator() Iterator
// MutableIterator MutableIterable
MutableIterator() MutableIterator
MutableIterator() *linkedListIterator
Push(element interface{}) exceptions.Exception
Offer() (interface{}, exceptions.Exception)

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module github.com/tursom/GoCollections
go 1.17

View File

@ -23,10 +23,10 @@ func main() {
}
_ = collections.LoopMutable(list, func(element interface{}, iterator collections.MutableIterator) (err exceptions.Exception) {
if element.(int)&1 == 0 {
if element.(int)&1 != 0 {
err = iterator.Remove()
fmt.Println(list)
}
fmt.Println(list)
return
})
//for i := 0; i < 10; i++ {