aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/tag.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2017-02-07 10:02:20 +0100
committerSantiago M. Mola <santi@mola.io>2017-02-07 10:02:20 +0100
commit1f39465975d56bbb02f5cdfb1e3e77f41c613f1d (patch)
treeac6b8caf7237a88092cbd20880d1beb118a668e3 /plumbing/object/tag.go
parent2b1efd219e1f20d9a0bc380a26074c9d8de2ae1f (diff)
downloadgo-git-1f39465975d56bbb02f5cdfb1e3e77f41c613f1d.tar.gz
doc: improve object iterators godoc.
Diffstat (limited to 'plumbing/object/tag.go')
-rw-r--r--plumbing/object/tag.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/plumbing/object/tag.go b/plumbing/object/tag.go
index 1b18dbf..7792491 100644
--- a/plumbing/object/tag.go
+++ b/plumbing/object/tag.go
@@ -223,16 +223,17 @@ type TagIter struct {
s storer.EncodedObjectStorer
}
-// NewTagIter returns a TagIter for the given object storer and underlying
-// object iterator.
+// NewTagIter takes a storer.EncodedObjectStorer and a
+// storer.EncodedObjectIter and returns a *TagIter that iterates over all
+// tags contained in the storer.EncodedObjectIter.
//
-// The returned TagIter will automatically skip over non-tag objects.
+// Any non-tag object returned by the storer.EncodedObjectIter is skipped.
func NewTagIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) *TagIter {
return &TagIter{iter, s}
}
-// Next moves the iterator to the next tag and returns a pointer to it. If it
-// has reached the end of the set it will return io.EOF.
+// Next moves the iterator to the next tag and returns a pointer to it. If
+// there are no more tags, it returns io.EOF.
func (iter *TagIter) Next() (*Tag, error) {
obj, err := iter.EncodedObjectIter.Next()
if err != nil {