aboutsummaryrefslogtreecommitdiffstats
path: root/tree_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-02-17 23:45:06 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-02-17 23:45:06 +0100
commitf57aa864e2b3c721d9511a2d78f0c0106e42677a (patch)
tree0cc85b4632818b7e9dd72d27a10698843304837b /tree_test.go
parent6b0a5984ac0c69742e60a39ad9437fd981dbe31b (diff)
parenta72c4ec54bb0502bd230dd007ebd1ef7b381afc7 (diff)
downloadgo-git-f57aa864e2b3c721d9511a2d78f0c0106e42677a.tar.gz
Merge pull request #30 from scjalliance/consistent-iterators
Improved consistency of Tree iterators
Diffstat (limited to 'tree_test.go')
-rw-r--r--tree_test.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/tree_test.go b/tree_test.go
index bec55dd..803ec56 100644
--- a/tree_test.go
+++ b/tree_test.go
@@ -192,7 +192,9 @@ func (s *SuiteTree) TestFiles(c *C) {
tree := commit.Tree()
var output []string
- for file := range tree.Files() {
+ iter := tree.Files()
+ defer iter.Close()
+ for file, err := iter.Next(); err == nil; file, err = iter.Next() {
output = append(output, file.Name)
}
sort.Strings(output)