diff --git a/.gitignore b/.gitignore index 66fd13c..503cefd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ # Binaries for programs and plugins +build/ + *.exe *.exe~ *.dll @@ -13,3 +15,4 @@ # Dependency directories (remove the comment below to include it) # vendor/ +.idea/ \ No newline at end of file diff --git a/go.mod b/go.mod index 047da77..1854c5c 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module asd.me +module github.com/asd go 1.19 diff --git a/pkg/collection/iterator.go b/pkg/collection/iterator.go index 3b27c5e..d89e83a 100644 --- a/pkg/collection/iterator.go +++ b/pkg/collection/iterator.go @@ -3,4 +3,9 @@ package collection type Iterator[E any] interface { HasNext() bool Next() E + NextWithIndex() (int, E) +} + +type Iterable[E any] interface { + Iterator() Iterator[E] } diff --git a/pkg/collection/stack_test.go b/pkg/collection/stack_test.go index b78875a..7b60e07 100644 --- a/pkg/collection/stack_test.go +++ b/pkg/collection/stack_test.go @@ -3,7 +3,7 @@ package collection_test import ( "testing" - "asd.me/pkg/collection" + "github.com/asd/pkg/collection" ) type pair struct {